<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, RecordWildCards, GADTs #-}</span><span>
</span><span id="line-2"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Cmm.LayoutStack</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-3"></span><span>       </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#cmmLayoutStack"><span class="hs-identifier">cmmLayoutStack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#setInfoTableStackMap"><span class="hs-identifier">setInfoTableStackMap</span></a></span><span>
</span><span id="line-4"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator">(&lt;*&gt;)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html"><span class="hs-identifier">GHC.StgToCmm.Utils</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#callerSaveVolatileRegs"><span class="hs-identifier">callerSaveVolatileRegs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier">newTemp</span></a></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- XXX layering violation</span><span>
</span><span id="line-9"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Foreign.html"><span class="hs-identifier">GHC.StgToCmm.Foreign</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Foreign.html#saveThreadState"><span class="hs-identifier">saveThreadState</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Foreign.html#loadThreadState"><span class="hs-identifier">loadThreadState</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- XXX layering violation</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.html"><span class="hs-identifier">GHC.Cmm.Info</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html"><span class="hs-identifier">GHC.Cmm.Graph</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.ForeignCall.html"><span class="hs-identifier">GHC.Types.ForeignCall</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html"><span class="hs-identifier">GHC.Cmm.Liveness</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html"><span class="hs-identifier">GHC.Cmm.ProcPoint</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Block</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html"><span class="hs-identifier">GHC.Cmm.Dataflow</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Graph</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Label</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#isEmpty"><span class="hs-identifier">isEmpty</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#"><span class="hs-identifier">Control.Monad.Fix</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.html#"><span class="hs-identifier">Data.Array</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Array</span></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier">nub</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">{- Note [Stack Layout]

The job of this pass is to

 - replace references to abstract stack Areas with fixed offsets from Sp.

 - replace the CmmHighStackMark constant used in the stack check with
   the maximum stack usage of the proc.

 - save any variables that are live across a call, and reload them as
   necessary.

Before stack allocation, local variables remain live across native
calls (CmmCall{ cmm_cont = Just _ }), and after stack allocation local
variables are clobbered by native calls.

We want to do stack allocation so that as far as possible
 - stack use is minimized, and
 - unnecessary stack saves and loads are avoided.

The algorithm we use is a variant of linear-scan register allocation,
where the stack is our register file.

We proceed in two passes, see Note [Two pass approach] for why they are not easy
to merge into one.

Pass 1:

 - First, we do a liveness analysis, which annotates every block with
   the variables live on entry to the block.

 - We traverse blocks in reverse postorder DFS; that is, we visit at
   least one predecessor of a block before the block itself.  The
   stack layout flowing from the predecessor of the block will
   determine the stack layout on entry to the block.

 - We maintain a data structure

     Map Label StackMap

   which describes the contents of the stack and the stack pointer on
   entry to each block that is a successor of a block that we have
   visited.

 - For each block we visit:

    - Look up the StackMap for this block.

    - If this block is a proc point (or a call continuation, if we aren't
      splitting proc points), we need to reload all the live variables from the
      stack - but this is done in Pass 2, which calculates more precise liveness
      information (see description of Pass 2).

    - Walk forwards through the instructions:
      - At an assignment  x = Sp[loc]
        - Record the fact that Sp[loc] contains x, so that we won't
          need to save x if it ever needs to be spilled.
      - At an assignment  x = E
        - If x was previously on the stack, it isn't any more
      - At the last node, if it is a call or a jump to a proc point
        - Lay out the stack frame for the call (see setupStackFrame)
        - emit instructions to save all the live variables
        - Remember the StackMaps for all the successors
        - emit an instruction to adjust Sp
      - If the last node is a branch, then the current StackMap is the
        StackMap for the successors.

    - Manifest Sp: replace references to stack areas in this block
      with real Sp offsets. We cannot do this until we have laid out
      the stack area for the successors above.

      In this phase we also eliminate redundant stores to the stack;
      see elimStackStores.

  - There is one important gotcha: sometimes we'll encounter a control
    transfer to a block that we've already processed (a join point),
    and in that case we might need to rearrange the stack to match
    what the block is expecting. (exactly the same as in linear-scan
    register allocation, except here we have the luxury of an infinite
    supply of temporary variables).

  - Finally, we update the magic CmmHighStackMark constant with the
    stack usage of the function, and eliminate the whole stack check
    if there was no stack use. (in fact this is done as part of the
    main traversal, by feeding the high-water-mark output back in as
    an input. I hate cyclic programming, but it's just too convenient
    sometimes.)

  There are plenty of tricky details: update frames, proc points, return
  addresses, foreign calls, and some ad-hoc optimisations that are
  convenient to do here and effective in common cases.  Comments in the
  code below explain these.

Pass 2:

- Calculate live registers, but taking into account that nothing is live at the
  entry to a proc point.

- At each proc point and call continuation insert reloads of live registers from
  the stack (they were saved by Pass 1).


Note [Two pass approach]

The main reason for Pass 2 is being able to insert only the reloads that are
needed and the fact that the two passes need different liveness information.
Let's consider an example:

  .....
   \ /
    D   &lt;- proc point
   / \
  E   F
   \ /
    G   &lt;- proc point
    |
    X

Pass 1 needs liveness assuming that local variables are preserved across calls.
This is important because it needs to save any local registers to the stack
(e.g., if register a is used in block X, it must be saved before any native
call).
However, for Pass 2, where we want to reload registers from stack (in a proc
point), this is overly conservative and would lead us to generate reloads in D
for things used in X, even though we're going to generate reloads in G anyway
(since it's also a proc point).
So Pass 2 calculates liveness knowing that nothing is live at the entry to a
proc point. This means that in D we only need to reload things used in E or F.
This can be quite important, for an extreme example see testcase for #3294.

Merging the two passes is not trivial - Pass 2 is a backward rewrite and Pass 1
is a forward one. Furthermore, Pass 1 is creating code that uses local registers
(saving them before a call), which the liveness analysis for Pass 2 must see to
be correct.

-}</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span>
</span><span id="line-180"></span><span class="hs-comment">-- All stack locations are expressed as positive byte offsets from the</span><span>
</span><span id="line-181"></span><span class="hs-comment">-- &quot;base&quot;, which is defined to be the address above the return address</span><span>
</span><span id="line-182"></span><span class="hs-comment">-- on the stack on entry to this CmmProc.</span><span>
</span><span id="line-183"></span><span class="hs-comment">--</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- Lower addresses have higher StackLocs.</span><span>
</span><span id="line-185"></span><span class="hs-comment">--</span><span>
</span><span id="line-186"></span><span class="hs-keyword">type</span><span> </span><span id="StackLoc"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-var">StackLoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="hs-comment">{-
 A StackMap describes the stack at any given point.  At a continuation
 it has a particular layout, like this:

         |             | &lt;- base
         |-------------|
         |     ret0    | &lt;- base + 8
         |-------------|
         .  upd frame  . &lt;- base + sm_ret_off
         |-------------|
         |             |
         .    vars     .
         . (live/dead) .
         |             | &lt;- base + sm_sp - sm_args
         |-------------|
         |    ret1     |
         .  ret vals   . &lt;- base + sm_sp    (&lt;--- Sp points here)
         |-------------|

Why do we include the final return address (ret0) in our stack map?  I
have absolutely no idea, but it seems to be done that way consistently
in the rest of the code generator, so I played along here. --SDM

Note that we will be constructing an info table for the continuation
(ret1), which needs to describe the stack down to, but not including,
the update frame (or ret0, if there is no update frame).
-}</span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span class="hs-keyword">data</span><span> </span><span id="StackMap"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-var">StackMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="StackMap"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-var">StackMap</span></a></span></span><span>
</span><span id="line-217"></span><span> </span><span class="hs-special">{</span><span>  </span><span id="sm_sp"><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-type">StackLoc</span></a></span><span>
</span><span id="line-218"></span><span>       </span><span class="hs-comment">-- ^ the offset of Sp relative to the base on entry</span><span>
</span><span id="line-219"></span><span>       </span><span class="hs-comment">-- to this block.</span><span>
</span><span id="line-220"></span><span> </span><span class="hs-special">,</span><span>  </span><span id="sm_args"><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_args"><span class="hs-identifier hs-var hs-var">sm_args</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-221"></span><span>       </span><span class="hs-comment">-- ^ the number of bytes of arguments in the area for this block</span><span>
</span><span id="line-222"></span><span>       </span><span class="hs-comment">-- Defn: the offset of young(L) relative to the base is given by</span><span>
</span><span id="line-223"></span><span>       </span><span class="hs-comment">-- (sm_sp - sm_args) of the StackMap for block L.</span><span>
</span><span id="line-224"></span><span> </span><span class="hs-special">,</span><span>  </span><span id="sm_ret_off"><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_ret_off"><span class="hs-identifier hs-var hs-var">sm_ret_off</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-225"></span><span>       </span><span class="hs-comment">-- ^ Number of words of stack that we do not describe with an info</span><span>
</span><span id="line-226"></span><span>       </span><span class="hs-comment">-- table, because it contains an update frame.</span><span>
</span><span id="line-227"></span><span> </span><span class="hs-special">,</span><span>  </span><span id="sm_regs"><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html#UniqFM"><span class="hs-identifier hs-type">UniqFM</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-type">StackLoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>       </span><span class="hs-comment">-- ^ regs on the stack</span><span>
</span><span id="line-229"></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681067019"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-232"></span><span>  </span><span id="local-6989586621681067015"><span class="annot"><span class="annottext">ppr :: StackMap -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">{</span><span id="local-6989586621681067010"><span id="local-6989586621681067011"><span id="local-6989586621681067012"><span id="local-6989586621681067013"><span class="annot"><span class="annottext">ByteOff
UniqFM LocalReg (LocalReg, ByteOff)
sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
sm_ret_off :: ByteOff
sm_args :: ByteOff
sm_sp :: ByteOff
sm_regs :: StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
sm_ret_off :: StackMap -&gt; ByteOff
sm_args :: StackMap -&gt; ByteOff
sm_sp :: StackMap -&gt; ByteOff
</span><a href="#local-6989586621681067010"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-233"></span><span>     </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Sp = &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681067013"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-234"></span><span>     </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sm_args = &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681067012"><span class="hs-identifier hs-var">sm_args</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-235"></span><span>     </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sm_ret_off = &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681067011"><span class="hs-identifier hs-var">sm_ret_off</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-236"></span><span>     </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sm_regs = &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; ([(LocalReg, ByteOff)] -&gt; SDoc) -&gt; SDoc
forall key a. UniqFM key a -&gt; ([a] -&gt; SDoc) -&gt; SDoc
</span><a href="GHC.Types.Unique.FM.html#pprUFM"><span class="hs-identifier hs-var">pprUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681067010"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, ByteOff)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#cmmLayoutStack"><span class="hs-identifier hs-type">cmmLayoutStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-240"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-241"></span><span id="cmmLayoutStack"><span class="annot"><span class="annottext">cmmLayoutStack :: DynFlags
-&gt; ProcPointSet
-&gt; ByteOff
-&gt; CmmGraph
-&gt; UniqSM (CmmGraph, LabelMap StackMap)
</span><a href="GHC.Cmm.LayoutStack.html#cmmLayoutStack"><span class="hs-identifier hs-var hs-var">cmmLayoutStack</span></a></span></span><span> </span><span id="local-6989586621681067004"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067004"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681067003"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681067003"><span class="hs-identifier hs-var">procpoints</span></a></span></span><span> </span><span id="local-6989586621681067002"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681067002"><span class="hs-identifier hs-var">entry_args</span></a></span></span><span>
</span><span id="line-242"></span><span>               </span><span id="local-6989586621681067001"><span class="annot"><span class="annottext">graph :: CmmGraph
</span><a href="#local-6989586621681067001"><span class="hs-identifier hs-var">graph</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">g_entry :: forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var">g_entry</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681066998"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066998"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-244"></span><span>    </span><span class="hs-comment">-- We need liveness info. Dead assignments are removed later</span><span>
</span><span id="line-245"></span><span>    </span><span class="hs-comment">-- by the sinking pass.</span><span>
</span><span id="line-246"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066997"><span class="annot"><span class="annottext">liveness :: BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066997"><span class="hs-identifier hs-var hs-var">liveness</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CmmGraph -&gt; BlockEntryLiveness LocalReg
</span><a href="GHC.Cmm.Liveness.html#cmmLocalLiveness"><span class="hs-identifier hs-var">cmmLocalLiveness</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067004"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681067001"><span class="hs-identifier hs-var">graph</span></a></span><span>
</span><span id="line-247"></span><span>        </span><span id="local-6989586621681066995"><span class="annot"><span class="annottext">blocks :: [CmmBlock]
</span><a href="#local-6989586621681066995"><span class="hs-identifier hs-var hs-var">blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; [CmmBlock]
</span><a href="GHC.Cmm.Utils.html#revPostorder"><span class="hs-identifier hs-var">revPostorder</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681067001"><span class="hs-identifier hs-var">graph</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681066993"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066993"><span class="hs-identifier hs-var">final_stackmaps</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066992"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066992"><span class="hs-identifier hs-var">_final_high_sp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066991"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066991"><span class="hs-identifier hs-var">new_blocks</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-250"></span><span>          </span><span class="annot"><span class="annottext">((LabelMap StackMap, ByteOff, [CmmBlock])
 -&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock]))
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
forall (m :: * -&gt; *) a. MonadFix m =&gt; (a -&gt; m a) -&gt; m a
</span><a href="../../base/src/Control.Monad.Fix.html#mfix"><span class="hs-identifier hs-var">mfix</span></a></span><span> </span><span class="annot"><span class="annottext">(((LabelMap StackMap, ByteOff, [CmmBlock])
  -&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock]))
 -&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock]))
-&gt; ((LabelMap StackMap, ByteOff, [CmmBlock])
    -&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock]))
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621681066990"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066990"><span class="hs-identifier hs-var">rec_stackmaps</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066989"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066989"><span class="hs-identifier hs-var">rec_high_sp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066988"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066988"><span class="hs-identifier hs-var">_new_blocks</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-251"></span><span>            </span><span class="annot"><span class="annottext">DynFlags
-&gt; ProcPointSet
-&gt; BlockEntryLiveness LocalReg
-&gt; BlockId
-&gt; ByteOff
-&gt; LabelMap StackMap
-&gt; ByteOff
-&gt; [CmmBlock]
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
</span><a href="GHC.Cmm.LayoutStack.html#layout"><span class="hs-identifier hs-var">layout</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067004"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681067003"><span class="hs-identifier hs-var">procpoints</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066997"><span class="hs-identifier hs-var">liveness</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066998"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681067002"><span class="hs-identifier hs-var">entry_args</span></a></span><span>
</span><span id="line-252"></span><span>                   </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066990"><span class="hs-identifier hs-var">rec_stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066989"><span class="hs-identifier hs-var">rec_high_sp</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066995"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span>    </span><span id="local-6989586621681066986"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066986"><span class="hs-identifier hs-var">blocks_with_reloads</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-255"></span><span>        </span><span class="annot"><span class="annottext">DynFlags
-&gt; ProcPointSet
-&gt; LabelMap StackMap
-&gt; BlockId
-&gt; [CmmBlock]
-&gt; UniqSM [CmmBlock]
</span><a href="GHC.Cmm.LayoutStack.html#insertReloadsAsNeeded"><span class="hs-identifier hs-var">insertReloadsAsNeeded</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067004"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681067003"><span class="hs-identifier hs-var">procpoints</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066993"><span class="hs-identifier hs-var">final_stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066998"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066991"><span class="hs-identifier hs-var">new_blocks</span></a></span><span>
</span><span id="line-256"></span><span>    </span><span id="local-6989586621681066984"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066984"><span class="hs-identifier hs-var">new_blocks'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(CmmBlock -&gt; UniqSM CmmBlock) -&gt; [CmmBlock] -&gt; UniqSM [CmmBlock]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmBlock -&gt; UniqSM CmmBlock
</span><a href="GHC.Cmm.LayoutStack.html#lowerSafeForeignCall"><span class="hs-identifier hs-var">lowerSafeForeignCall</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681067004"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066986"><span class="hs-identifier hs-var">blocks_with_reloads</span></a></span><span>
</span><span id="line-257"></span><span>    </span><span class="annot"><span class="annottext">(CmmGraph, LabelMap StackMap)
-&gt; UniqSM (CmmGraph, LabelMap StackMap)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; [CmmBlock] -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockList"><span class="hs-identifier hs-var">ofBlockList</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066998"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066984"><span class="hs-identifier hs-var">new_blocks'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066993"><span class="hs-identifier hs-var">final_stackmaps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-260"></span><span class="hs-comment">-- Pass 1</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#layout"><span class="hs-identifier hs-type">layout</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-264"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span>                      </span><span class="hs-comment">-- proc points</span><span>
</span><span id="line-265"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html#CmmLocalLive"><span class="hs-identifier hs-type">CmmLocalLive</span></a></span><span>         </span><span class="hs-comment">-- liveness</span><span>
</span><span id="line-266"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>                       </span><span class="hs-comment">-- entry</span><span>
</span><span id="line-267"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>                       </span><span class="hs-comment">-- stack args on entry</span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>             </span><span class="hs-comment">-- [final] stack maps</span><span>
</span><span id="line-270"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>                       </span><span class="hs-comment">-- [final] Sp high water mark</span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>                    </span><span class="hs-comment">-- [in] blocks</span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span>
</span><span id="line-275"></span><span>          </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>           </span><span class="hs-comment">-- [out] stack maps</span><span>
</span><span id="line-276"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>                     </span><span class="hs-comment">-- [out] Sp high water mark</span><span>
</span><span id="line-277"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>                  </span><span class="hs-comment">-- [out] new blocks</span><span>
</span><span id="line-278"></span><span>          </span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span id="layout"><span class="annot"><span class="annottext">layout :: DynFlags
-&gt; ProcPointSet
-&gt; BlockEntryLiveness LocalReg
-&gt; BlockId
-&gt; ByteOff
-&gt; LabelMap StackMap
-&gt; ByteOff
-&gt; [CmmBlock]
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
</span><a href="GHC.Cmm.LayoutStack.html#layout"><span class="hs-identifier hs-var hs-var">layout</span></a></span></span><span> </span><span id="local-6989586621681066979"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066979"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066978"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066978"><span class="hs-identifier hs-var">procpoints</span></a></span></span><span> </span><span id="local-6989586621681066977"><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066977"><span class="hs-identifier hs-var">liveness</span></a></span></span><span> </span><span id="local-6989586621681066976"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066976"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span id="local-6989586621681066975"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066975"><span class="hs-identifier hs-var">entry_args</span></a></span></span><span> </span><span id="local-6989586621681066974"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066974"><span class="hs-identifier hs-var">final_stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066973"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066973"><span class="hs-identifier hs-var">final_sp_high</span></a></span></span><span> </span><span id="local-6989586621681066972"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066972"><span class="hs-identifier hs-var">blocks</span></a></span></span><span>
</span><span id="line-281"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
-&gt; LabelMap StackMap
-&gt; ByteOff
-&gt; [CmmBlock]
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
</span><a href="#local-6989586621681066971"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066972"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066970"><span class="hs-identifier hs-var">init_stackmap</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066975"><span class="hs-identifier hs-var">entry_args</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-282"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-283"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681066969"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066969"><span class="hs-identifier hs-var">updfr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066968"><span class="annot"><span class="annottext">LabelMap ByteOff
</span><a href="#local-6989586621681066968"><span class="hs-identifier hs-var">cont_info</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; (ByteOff, LabelMap ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#collectContInfo"><span class="hs-identifier hs-var">collectContInfo</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066972"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span>    </span><span id="local-6989586621681066970"><span class="annot"><span class="annottext">init_stackmap :: LabelMap StackMap
</span><a href="#local-6989586621681066970"><span class="hs-identifier hs-var hs-var">init_stackmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; StackMap -&gt; LabelMap StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSingleton"><span class="hs-identifier hs-var">mapSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066976"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap :: ByteOff
-&gt; ByteOff
-&gt; ByteOff
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
-&gt; StackMap
</span><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_sp :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var">sm_sp</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066975"><span class="hs-identifier hs-var">entry_args</span></a></span><span>
</span><span id="line-286"></span><span>                                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_args :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_args"><span class="hs-identifier hs-var">sm_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066975"><span class="hs-identifier hs-var">entry_args</span></a></span><span>
</span><span id="line-287"></span><span>                                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_ret_off :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_ret_off"><span class="hs-identifier hs-var">sm_ret_off</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066969"><span class="hs-identifier hs-var">updfr</span></a></span><span>
</span><span id="line-288"></span><span>                                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
forall key elt. UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#emptyUFM"><span class="hs-identifier hs-var">emptyUFM</span></a></span><span>
</span><span id="line-289"></span><span>                                               </span><span class="hs-special">}</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span>    </span><span id="local-6989586621681066971"><span class="annot"><span class="annottext">go :: [CmmBlock]
-&gt; LabelMap StackMap
-&gt; ByteOff
-&gt; [CmmBlock]
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
</span><a href="#local-6989586621681066971"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681066964"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066964"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066963"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066963"><span class="hs-identifier hs-var">acc_hwm</span></a></span></span><span> </span><span id="local-6989586621681066962"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066962"><span class="hs-identifier hs-var">acc_blocks</span></a></span></span><span>
</span><span id="line-292"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap StackMap, ByteOff, [CmmBlock])
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066964"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066963"><span class="hs-identifier hs-var">acc_hwm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066962"><span class="hs-identifier hs-var">acc_blocks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span>    </span><span class="annot"><a href="#local-6989586621681066971"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066961"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066961"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681066960"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066960"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066959"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066959"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066958"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066958"><span class="hs-identifier hs-var">acc_hwm</span></a></span></span><span> </span><span id="local-6989586621681066957"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066957"><span class="hs-identifier hs-var">acc_blocks</span></a></span></span><span>
</span><span id="line-295"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-296"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066956"><span class="annot"><span class="annottext">entry0 :: CmmNode C O
</span><a href="#local-6989586621681066956"><span class="hs-identifier hs-var">entry0</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-type">CmmEntry</span></a></span><span> </span><span id="local-6989586621681066952"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066952"><span class="hs-identifier hs-var">entry_lbl</span></a></span></span><span> </span><span id="local-6989586621681066951"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066951"><span class="hs-identifier hs-var">tscope</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066950"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066950"><span class="hs-identifier hs-var">middle0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066949"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066949"><span class="hs-identifier hs-var">last0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (CmmNode C O, Block CmmNode O O, CmmNode O C)
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n C C -&gt; (n C O, Block n O O, n O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplit"><span class="hs-identifier hs-var">blockSplit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066961"><span class="hs-identifier hs-var">b0</span></a></span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066947"><span class="annot"><span class="annottext">stack0 :: StackMap
</span><a href="#local-6989586621681066947"><span class="hs-identifier hs-var">stack0</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_sp :: StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681066946"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066946"><span class="hs-identifier hs-var">sp0</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-299"></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; KeyOf LabelMap -&gt; LabelMap StackMap -&gt; StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span>
</span><span id="line-300"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; StackMap
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no stack map for&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066952"><span class="hs-identifier hs-var">entry_lbl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span>                     </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066952"><span class="hs-identifier hs-var">entry_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066959"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span>       </span><span class="hs-comment">-- (a) Update the stack map to include the effects of</span><span>
</span><span id="line-304"></span><span>       </span><span class="hs-comment">--     assignments in this block</span><span>
</span><span id="line-305"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066943"><span class="annot"><span class="annottext">stack1 :: IndexedCO O StackMap StackMap
</span><a href="#local-6989586621681066943"><span class="hs-identifier hs-var hs-var">stack1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall (e :: Extensibility) (x :: Extensibility).
 CmmNode e x -&gt; StackMap -&gt; StackMap)
-&gt; forall (e :: Extensibility) (x :: Extensibility).
   Block CmmNode e x
   -&gt; IndexedCO e StackMap StackMap -&gt; IndexedCO x StackMap StackMap
forall (n :: Extensibility -&gt; Extensibility -&gt; *) a.
(forall (e :: Extensibility) (x :: Extensibility). n e x -&gt; a -&gt; a)
-&gt; forall (e :: Extensibility) (x :: Extensibility).
   Block n e x -&gt; IndexedCO e a a -&gt; IndexedCO x a a
</span><a href="GHC.Cmm.Dataflow.Block.html#foldBlockNodesF"><span class="hs-identifier hs-var">foldBlockNodesF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap StackMap -&gt; CmmNode e x -&gt; StackMap -&gt; StackMap
forall (e :: Extensibility) (x :: Extensibility).
LabelMap StackMap -&gt; CmmNode e x -&gt; StackMap -&gt; StackMap
</span><a href="GHC.Cmm.LayoutStack.html#procMiddle"><span class="hs-identifier hs-var">procMiddle</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066959"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066950"><span class="hs-identifier hs-var">middle0</span></a></span><span> </span><span class="annot"><span class="annottext">IndexedCO O StackMap StackMap
StackMap
</span><a href="#local-6989586621681066947"><span class="hs-identifier hs-var">stack0</span></a></span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span>       </span><span class="hs-comment">-- (b) Look at the last node and if we are making a call or</span><span>
</span><span id="line-308"></span><span>       </span><span class="hs-comment">--     jumping to a proc point, we must save the live</span><span>
</span><span id="line-309"></span><span>       </span><span class="hs-comment">--     variables, adjust Sp, and construct the StackMaps for</span><span>
</span><span id="line-310"></span><span>       </span><span class="hs-comment">--     each of the successor blocks.  See handleLastNode for</span><span>
</span><span id="line-311"></span><span>       </span><span class="hs-comment">--     details.</span><span>
</span><span id="line-312"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681066940"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066940"><span class="hs-identifier hs-var">middle1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066939"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066939"><span class="hs-identifier hs-var">sp_off</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066938"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066938"><span class="hs-identifier hs-var">last1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066937"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066937"><span class="hs-identifier hs-var">fixup_blocks</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066936"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066936"><span class="hs-identifier hs-var">out</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-313"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; ProcPointSet
-&gt; BlockEntryLiveness LocalReg
-&gt; LabelMap ByteOff
-&gt; LabelMap StackMap
-&gt; StackMap
-&gt; CmmTickScope
-&gt; Block CmmNode O O
-&gt; CmmNode O C
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
</span><a href="GHC.Cmm.LayoutStack.html#handleLastNode"><span class="hs-identifier hs-var">handleLastNode</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066979"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066978"><span class="hs-identifier hs-var">procpoints</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066977"><span class="hs-identifier hs-var">liveness</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap ByteOff
</span><a href="#local-6989586621681066968"><span class="hs-identifier hs-var">cont_info</span></a></span><span>
</span><span id="line-314"></span><span>                             </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066959"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">IndexedCO O StackMap StackMap
StackMap
</span><a href="#local-6989586621681066943"><span class="hs-identifier hs-var">stack1</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066951"><span class="hs-identifier hs-var">tscope</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066950"><span class="hs-identifier hs-var">middle0</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066949"><span class="hs-identifier hs-var">last0</span></a></span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span>       </span><span class="hs-comment">-- (c) Manifest Sp: run over the nodes in the block and replace</span><span>
</span><span id="line-317"></span><span>       </span><span class="hs-comment">--     CmmStackSlot with CmmLoad from Sp with a concrete offset.</span><span>
</span><span id="line-318"></span><span>       </span><span class="hs-comment">--</span><span>
</span><span id="line-319"></span><span>       </span><span class="hs-comment">-- our block:</span><span>
</span><span id="line-320"></span><span>       </span><span class="hs-comment">--    middle0          -- the original middle nodes</span><span>
</span><span id="line-321"></span><span>       </span><span class="hs-comment">--    middle1          -- live variable saves from handleLastNode</span><span>
</span><span id="line-322"></span><span>       </span><span class="hs-comment">--    Sp = Sp + sp_off -- Sp adjustment goes here</span><span>
</span><span id="line-323"></span><span>       </span><span class="hs-comment">--    last1            -- the last node</span><span>
</span><span id="line-324"></span><span>       </span><span class="hs-comment">--</span><span>
</span><span id="line-325"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066934"><span class="annot"><span class="annottext">middle_pre :: [CmmNode O O]
</span><a href="#local-6989586621681066934"><span class="hs-identifier hs-var hs-var">middle_pre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; [CmmNode O O]
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n O O -&gt; [n O O]
</span><a href="GHC.Cmm.Dataflow.Block.html#blockToList"><span class="hs-identifier hs-var">blockToList</span></a></span><span> </span><span class="annot"><span class="annottext">(Block CmmNode O O -&gt; [CmmNode O O])
-&gt; Block CmmNode O O -&gt; [CmmNode O O]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Block CmmNode O O -&gt; CmmNode O O -&gt; Block CmmNode O O)
-&gt; Block CmmNode O O -&gt; [CmmNode O O] -&gt; Block CmmNode O O
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; CmmNode O O -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e O -&gt; n O O -&gt; Block n e O
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSnoc"><span class="hs-identifier hs-var">blockSnoc</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066950"><span class="hs-identifier hs-var">middle0</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066940"><span class="hs-identifier hs-var">middle1</span></a></span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066930"><span class="annot"><span class="annottext">final_blocks :: [CmmBlock]
</span><a href="#local-6989586621681066930"><span class="hs-identifier hs-var hs-var">final_blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-328"></span><span>               </span><span class="annot"><span class="annottext">DynFlags
-&gt; LabelMap StackMap
-&gt; StackMap
-&gt; ByteOff
-&gt; ByteOff
-&gt; CmmNode C O
-&gt; [CmmNode O O]
-&gt; ByteOff
-&gt; CmmNode O C
-&gt; [CmmBlock]
-&gt; [CmmBlock]
</span><a href="GHC.Cmm.LayoutStack.html#manifestSp"><span class="hs-identifier hs-var">manifestSp</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066979"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066974"><span class="hs-identifier hs-var">final_stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066947"><span class="hs-identifier hs-var">stack0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066946"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066973"><span class="hs-identifier hs-var">final_sp_high</span></a></span><span>
</span><span id="line-329"></span><span>                          </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066956"><span class="hs-identifier hs-var">entry0</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066934"><span class="hs-identifier hs-var">middle_pre</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066939"><span class="hs-identifier hs-var">sp_off</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066938"><span class="hs-identifier hs-var">last1</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066937"><span class="hs-identifier hs-var">fixup_blocks</span></a></span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066928"><span class="annot"><span class="annottext">acc_stackmaps' :: LabelMap StackMap
</span><a href="#local-6989586621681066928"><span class="hs-identifier hs-var hs-var">acc_stackmaps'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap -&gt; LabelMap StackMap -&gt; LabelMap StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapUnion"><span class="hs-identifier hs-var">mapUnion</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066959"><span class="hs-identifier hs-var">acc_stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066936"><span class="hs-identifier hs-var">out</span></a></span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span>           </span><span class="hs-comment">-- If this block jumps to the GC, then we do not take its</span><span>
</span><span id="line-334"></span><span>           </span><span class="hs-comment">-- stack usage into account for the high-water mark.</span><span>
</span><span id="line-335"></span><span>           </span><span class="hs-comment">-- Otherwise, if the only stack usage is in the stack-check</span><span>
</span><span id="line-336"></span><span>           </span><span class="hs-comment">-- failure block itself, we will do a redundant stack</span><span>
</span><span id="line-337"></span><span>           </span><span class="hs-comment">-- check.  The stack has a buffer designed to accommodate</span><span>
</span><span id="line-338"></span><span>           </span><span class="hs-comment">-- the largest amount of stack needed for calling the GC.</span><span>
</span><span id="line-339"></span><span>           </span><span class="hs-comment">--</span><span>
</span><span id="line-340"></span><span>           </span><span id="local-6989586621681066926"><span class="annot"><span class="annottext">this_sp_hwm :: ByteOff
</span><a href="#local-6989586621681066926"><span class="hs-identifier hs-var hs-var">this_sp_hwm</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#isGcJump"><span class="hs-identifier hs-var">isGcJump</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066949"><span class="hs-identifier hs-var">last0</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-341"></span><span>                       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066946"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066939"><span class="hs-identifier hs-var">sp_off</span></a></span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span>           </span><span id="local-6989586621681066924"><span class="annot"><span class="annottext">hwm' :: ByteOff
</span><a href="#local-6989586621681066924"><span class="hs-identifier hs-var hs-var">hwm'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteOff] -&gt; ByteOff
forall (t :: * -&gt; *) a. (Foldable t, Ord a) =&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#maximum"><span class="hs-identifier hs-var">maximum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066958"><span class="hs-identifier hs-var">acc_hwm</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; [ByteOff] -&gt; [ByteOff]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066926"><span class="hs-identifier hs-var">this_sp_hwm</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; [ByteOff] -&gt; [ByteOff]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">(StackMap -&gt; ByteOff) -&gt; [StackMap] -&gt; [ByteOff]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap StackMap -&gt; [StackMap]
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; [a]
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapElems"><span class="hs-identifier hs-var">mapElems</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066936"><span class="hs-identifier hs-var">out</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span>       </span><span class="annot"><span class="annottext">[CmmBlock]
-&gt; LabelMap StackMap
-&gt; ByteOff
-&gt; [CmmBlock]
-&gt; UniqSM (LabelMap StackMap, ByteOff, [CmmBlock])
</span><a href="#local-6989586621681066971"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066960"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066928"><span class="hs-identifier hs-var">acc_stackmaps'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066924"><span class="hs-identifier hs-var">hwm'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066930"><span class="hs-identifier hs-var">final_blocks</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; [CmmBlock] -&gt; [CmmBlock]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066957"><span class="hs-identifier hs-var">acc_blocks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-346"></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span class="hs-comment">-- Not foolproof, but GCFun is the culprit we most want to catch</span><span>
</span><span id="line-351"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#isGcJump"><span class="hs-identifier hs-type">isGcJump</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-352"></span><span id="isGcJump"><span class="annot"><span class="annottext">isGcJump :: CmmNode O C -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#isGcJump"><span class="hs-identifier hs-var hs-var">isGcJump</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_target :: CmmNode O C -&gt; CmmExpr
</span><a href="GHC.Cmm.Node.html#cml_target"><span class="hs-identifier hs-var">cml_target</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-type">CmmGlobal</span></a></span><span> </span><span id="local-6989586621681066912"><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681066912"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681066912"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg -&gt; GlobalReg -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#GCFun"><span class="hs-identifier hs-var">GCFun</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="#local-6989586621681066912"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg -&gt; GlobalReg -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#GCEnter1"><span class="hs-identifier hs-var">GCEnter1</span></a></span><span>
</span><span id="line-354"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#isGcJump"><span class="hs-identifier hs-var">isGcJump</span></a></span><span> </span><span id="local-6989586621681066908"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066908"><span class="hs-identifier hs-var">_something_else</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">-- This doesn't seem right somehow.  We need to find out whether this</span><span>
</span><span id="line-359"></span><span class="hs-comment">-- proc will push some update frame material at some point, so that we</span><span>
</span><span id="line-360"></span><span class="hs-comment">-- can avoid using that area of the stack for spilling. Ideally we would</span><span>
</span><span id="line-361"></span><span class="hs-comment">-- capture this information in the CmmProc (e.g. in CmmStackInfo; see #18232</span><span>
</span><span id="line-362"></span><span class="hs-comment">-- for details on one ill-fated attempt at this).</span><span>
</span><span id="line-363"></span><span class="hs-comment">--</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- So we'll just take the max of all the cml_ret_offs.  This could be</span><span>
</span><span id="line-365"></span><span class="hs-comment">-- unnecessarily pessimistic, but probably not in the code we</span><span>
</span><span id="line-366"></span><span class="hs-comment">-- generate.</span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#collectContInfo"><span class="hs-identifier hs-type">collectContInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span id="collectContInfo"><span class="annot"><span class="annottext">collectContInfo :: [CmmBlock] -&gt; (ByteOff, LabelMap ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#collectContInfo"><span class="hs-identifier hs-var hs-var">collectContInfo</span></a></span></span><span> </span><span id="local-6989586621681066907"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066907"><span class="hs-identifier hs-var">blocks</span></a></span></span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ByteOff] -&gt; ByteOff
forall (t :: * -&gt; *) a. (Foldable t, Ord a) =&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#maximum"><span class="hs-identifier hs-var">maximum</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteOff]
</span><a href="#local-6989586621681066906"><span class="hs-identifier hs-var">ret_offs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, ByteOff)] -&gt; LabelMap ByteOff
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Maybe (BlockId, ByteOff)] -&gt; [(BlockId, ByteOff)]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (BlockId, ByteOff)]
</span><a href="#local-6989586621681066903"><span class="hs-identifier hs-var">mb_argss</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-371"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-372"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681066903"><span class="annot"><span class="annottext">[Maybe (BlockId, ByteOff)]
</span><a href="#local-6989586621681066903"><span class="hs-identifier hs-var">mb_argss</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066906"><span class="annot"><span class="annottext">[ByteOff]
</span><a href="#local-6989586621681066906"><span class="hs-identifier hs-var">ret_offs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmBlock -&gt; (Maybe (BlockId, ByteOff), ByteOff))
-&gt; [CmmBlock] -&gt; ([Maybe (BlockId, ByteOff)], [ByteOff])
forall a b c. (a -&gt; (b, c)) -&gt; [a] -&gt; ([b], [c])
</span><a href="GHC.Utils.Misc.html#mapAndUnzip"><span class="hs-identifier hs-var">mapAndUnzip</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (Maybe (BlockId, ByteOff), ByteOff)
forall (x :: Extensibility).
Block CmmNode x C -&gt; (Maybe (BlockId, ByteOff), ByteOff)
</span><a href="#local-6989586621681066901"><span class="hs-identifier hs-var">get_cont</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066907"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span>  </span><span id="local-6989586621681067377"><span class="annot"><a href="#local-6989586621681066901"><span class="hs-identifier hs-type">get_cont</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067377"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-375"></span><span>  </span><span id="local-6989586621681066901"><span class="annot"><span class="annottext">get_cont :: forall (x :: Extensibility).
Block CmmNode x C -&gt; (Maybe (BlockId, ByteOff), ByteOff)
</span><a href="#local-6989586621681066901"><span class="hs-identifier hs-var hs-var">get_cont</span></a></span></span><span> </span><span id="local-6989586621681066899"><span class="annot"><span class="annottext">Block CmmNode x C
</span><a href="#local-6989586621681066899"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-376"></span><span>     </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Block CmmNode x C -&gt; CmmNode O C
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n x C -&gt; n O C
</span><a href="GHC.Cmm.Dataflow.Block.html#lastNode"><span class="hs-identifier hs-var">lastNode</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode x C
</span><a href="#local-6989586621681066899"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-377"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_cont :: CmmNode O C -&gt; Maybe BlockId
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066894"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066894"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066889"><span id="local-6989586621681066890"><span id="local-6989586621681066891"><span id="local-6989586621681066892"><span id="local-6989586621681066893"><span class="annot"><span class="annottext">ByteOff
[GlobalReg]
CmmExpr
cml_ret_off :: CmmNode O C -&gt; ByteOff
cml_ret_args :: CmmNode O C -&gt; ByteOff
cml_args_regs :: CmmNode O C -&gt; [GlobalReg]
cml_args :: CmmNode O C -&gt; ByteOff
cml_ret_off :: ByteOff
cml_ret_args :: ByteOff
cml_args :: ByteOff
cml_args_regs :: [GlobalReg]
cml_target :: CmmExpr
cml_target :: CmmNode O C -&gt; CmmExpr
</span><a href="GHC.Cmm.Node.html#cml_ret_off"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-378"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BlockId, ByteOff) -&gt; Maybe (BlockId, ByteOff)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066894"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066890"><span class="hs-identifier hs-var">cml_ret_args</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066889"><span class="hs-identifier hs-var">cml_ret_off</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>        </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681066875"><span id="local-6989586621681066876"><span id="local-6989586621681066877"><span id="local-6989586621681066878"><span id="local-6989586621681066879"><span id="local-6989586621681066880"><span id="local-6989586621681066881"><span class="annot"><span class="annottext">Bool
ByteOff
[CmmExpr]
[LocalReg]
BlockId
ForeignTarget
tgt :: CmmNode O C -&gt; ForeignTarget
succ :: CmmNode O C -&gt; BlockId
ret_off :: CmmNode O C -&gt; ByteOff
ret_args :: CmmNode O C -&gt; ByteOff
res :: CmmNode O C -&gt; [LocalReg]
intrbl :: CmmNode O C -&gt; Bool
args :: CmmNode O C -&gt; [CmmExpr]
intrbl :: Bool
ret_off :: ByteOff
ret_args :: ByteOff
succ :: BlockId
args :: [CmmExpr]
res :: [LocalReg]
tgt :: ForeignTarget
</span><a href="GHC.Cmm.Node.html#tgt"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-380"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BlockId, ByteOff) -&gt; Maybe (BlockId, ByteOff)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066878"><span class="hs-identifier hs-var">succ</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066877"><span class="hs-identifier hs-var">ret_args</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066876"><span class="hs-identifier hs-var">ret_off</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-381"></span><span>        </span><span id="local-6989586621681066867"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066867"><span class="hs-identifier hs-var">_other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (BlockId, ByteOff)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-385"></span><span class="hs-comment">-- Updating the StackMap from middle nodes</span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span class="hs-comment">-- Look for loads from stack slots, and update the StackMap.  This is</span><span>
</span><span id="line-388"></span><span class="hs-comment">-- purely for optimisation reasons, so that we can avoid saving a</span><span>
</span><span id="line-389"></span><span class="hs-comment">-- variable back to a different stack slot if it is already on the</span><span>
</span><span id="line-390"></span><span class="hs-comment">-- stack.</span><span>
</span><span id="line-391"></span><span class="hs-comment">--</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- This happens a lot: for example when function arguments are passed</span><span>
</span><span id="line-393"></span><span class="hs-comment">-- on the stack and need to be immediately saved across a call, we</span><span>
</span><span id="line-394"></span><span class="hs-comment">-- want to just leave them where they are on the stack.</span><span>
</span><span id="line-395"></span><span class="hs-comment">--</span><span>
</span><span id="line-396"></span><span id="local-6989586621681067400"><span id="local-6989586621681067401"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#procMiddle"><span class="hs-identifier hs-type">procMiddle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067401"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067400"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span></span></span><span>
</span><span id="line-397"></span><span id="procMiddle"><span class="annot"><span class="annottext">procMiddle :: forall (e :: Extensibility) (x :: Extensibility).
LabelMap StackMap -&gt; CmmNode e x -&gt; StackMap -&gt; StackMap
</span><a href="GHC.Cmm.LayoutStack.html#procMiddle"><span class="hs-identifier hs-var hs-var">procMiddle</span></a></span></span><span> </span><span id="local-6989586621681066866"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066866"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066865"><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681066865"><span class="hs-identifier hs-var">node</span></a></span></span><span> </span><span id="local-6989586621681066864"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066864"><span class="hs-identifier hs-var">sm</span></a></span></span><span>
</span><span id="line-398"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681066865"><span class="hs-identifier hs-var">node</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-399"></span><span>     </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmAssign"><span class="hs-identifier hs-type">CmmAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-type">CmmLocal</span></a></span><span> </span><span id="local-6989586621681066858"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066858"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-type">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-type">CmmStackSlot</span></a></span><span> </span><span id="local-6989586621681066855"><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681066855"><span class="hs-identifier hs-var">area</span></a></span></span><span> </span><span id="local-6989586621681066854"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066854"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmType
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066864"><span class="hs-identifier hs-var">sm</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; LocalReg
-&gt; (LocalReg, ByteOff)
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; key -&gt; elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addToUFM"><span class="hs-identifier hs-var">addToUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066864"><span class="hs-identifier hs-var">sm</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066858"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066858"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066852"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066852"><span class="annot"><span class="annottext">loc :: ByteOff
</span><a href="#local-6989586621681066852"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff -&gt; LabelMap StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#getStackLoc"><span class="hs-identifier hs-var">getStackLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681066855"><span class="hs-identifier hs-var">area</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066854"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066866"><span class="hs-identifier hs-var">stackmaps</span></a></span><span>
</span><span id="line-402"></span><span>     </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmAssign"><span class="hs-identifier hs-type">CmmAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-type">CmmLocal</span></a></span><span> </span><span id="local-6989586621681066847"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066847"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066846"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681066846"><span class="hs-identifier hs-var">_other</span></a></span></span><span>
</span><span id="line-403"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066864"><span class="hs-identifier hs-var">sm</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; LocalReg -&gt; UniqFM LocalReg (LocalReg, ByteOff)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; key -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#delFromUFM"><span class="hs-identifier hs-var">delFromUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066864"><span class="hs-identifier hs-var">sm</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066847"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-404"></span><span>     </span><span id="local-6989586621681066844"><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681066844"><span class="hs-identifier hs-var">_other</span></a></span></span><span>
</span><span id="line-405"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066864"><span class="hs-identifier hs-var">sm</span></a></span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#getStackLoc"><span class="hs-identifier hs-type">getStackLoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#Area"><span class="hs-identifier hs-type">Area</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-type">StackLoc</span></a></span><span>
</span><span id="line-408"></span><span id="getStackLoc"><span class="annot"><span class="annottext">getStackLoc :: Area -&gt; ByteOff -&gt; LabelMap StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#getStackLoc"><span class="hs-identifier hs-var hs-var">getStackLoc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="GHC.Cmm.Expr.html#Old"><span class="hs-identifier hs-var">Old</span></a></span><span>       </span><span id="local-6989586621681066842"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066842"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066842"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-409"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#getStackLoc"><span class="hs-identifier hs-var">getStackLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-type">Young</span></a></span><span> </span><span id="local-6989586621681066840"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066840"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066839"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066839"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681066838"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066838"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-410"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap StackMap -&gt; Maybe StackMap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066840"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066838"><span class="hs-identifier hs-var">stackmaps</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-411"></span><span>    </span><span class="annot"><span class="annottext">Maybe StackMap
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ByteOff
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getStackLoc&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066840"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-412"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066836"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066836"><span class="hs-identifier hs-var">sm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066836"><span class="hs-identifier hs-var">sm</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_args"><span class="hs-identifier hs-var hs-var">sm_args</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066836"><span class="hs-identifier hs-var">sm</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066839"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-416"></span><span class="hs-comment">-- Handling stack allocation for a last node</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="hs-comment">-- We take a single last node and turn it into:</span><span>
</span><span id="line-419"></span><span class="hs-comment">--</span><span>
</span><span id="line-420"></span><span class="hs-comment">--    C1 (some statements)</span><span>
</span><span id="line-421"></span><span class="hs-comment">--    Sp = Sp + N</span><span>
</span><span id="line-422"></span><span class="hs-comment">--    C2 (some more statements)</span><span>
</span><span id="line-423"></span><span class="hs-comment">--    call f()          -- the actual last node</span><span>
</span><span id="line-424"></span><span class="hs-comment">--</span><span>
</span><span id="line-425"></span><span class="hs-comment">-- plus possibly some more blocks (we may have to add some fixup code</span><span>
</span><span id="line-426"></span><span class="hs-comment">-- between the last node and the continuation).</span><span>
</span><span id="line-427"></span><span class="hs-comment">--</span><span>
</span><span id="line-428"></span><span class="hs-comment">-- C1: is the code for saving the variables across this last node onto</span><span>
</span><span id="line-429"></span><span class="hs-comment">-- the stack, if the continuation is a call or jumps to a proc point.</span><span>
</span><span id="line-430"></span><span class="hs-comment">--</span><span>
</span><span id="line-431"></span><span class="hs-comment">-- C2: if the last node is a safe foreign call, we have to inject some</span><span>
</span><span id="line-432"></span><span class="hs-comment">-- extra code that goes *after* the Sp adjustment.</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#handleLastNode"><span class="hs-identifier hs-type">handleLastNode</span></a></span><span>
</span><span id="line-435"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html#CmmLocalLive"><span class="hs-identifier hs-type">CmmLocalLive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-436"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmTickScope"><span class="hs-identifier hs-type">CmmTickScope</span></a></span><span>
</span><span id="line-437"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span>
</span><span id="line-438"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>
</span><span id="line-439"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span>
</span><span id="line-440"></span><span>      </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- nodes to go *before* the Sp adjustment</span><span>
</span><span id="line-441"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>            </span><span class="hs-comment">-- amount to adjust Sp</span><span>
</span><span id="line-442"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>        </span><span class="hs-comment">-- new last node</span><span>
</span><span id="line-443"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- new blocks</span><span>
</span><span id="line-444"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>  </span><span class="hs-comment">-- stackmaps for the continuations</span><span>
</span><span id="line-445"></span><span>      </span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span id="handleLastNode"><span class="annot"><span class="annottext">handleLastNode :: DynFlags
-&gt; ProcPointSet
-&gt; BlockEntryLiveness LocalReg
-&gt; LabelMap ByteOff
-&gt; LabelMap StackMap
-&gt; StackMap
-&gt; CmmTickScope
-&gt; Block CmmNode O O
-&gt; CmmNode O C
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
</span><a href="GHC.Cmm.LayoutStack.html#handleLastNode"><span class="hs-identifier hs-var hs-var">handleLastNode</span></a></span></span><span> </span><span id="local-6989586621681066834"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066834"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066833"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066833"><span class="hs-identifier hs-var">procpoints</span></a></span></span><span> </span><span id="local-6989586621681066832"><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066832"><span class="hs-identifier hs-var">liveness</span></a></span></span><span> </span><span id="local-6989586621681066831"><span class="annot"><span class="annottext">LabelMap ByteOff
</span><a href="#local-6989586621681066831"><span class="hs-identifier hs-var">cont_info</span></a></span></span><span> </span><span id="local-6989586621681066830"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066830"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span>
</span><span id="line-448"></span><span>               </span><span id="local-6989586621681066829"><span class="annot"><span class="annottext">stack0 :: StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_sp :: StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681066828"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066828"><span class="hs-identifier hs-var">sp0</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span id="local-6989586621681066827"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066827"><span class="hs-identifier hs-var">tscp</span></a></span></span><span> </span><span id="local-6989586621681066826"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066826"><span class="hs-identifier hs-var">middle</span></a></span></span><span> </span><span id="local-6989586621681066825"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span></span><span>
</span><span id="line-449"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-450"></span><span>    </span><span class="hs-comment">--  At each return / tail call,</span><span>
</span><span id="line-451"></span><span>    </span><span class="hs-comment">--  adjust Sp to point to the last argument pushed, which</span><span>
</span><span id="line-452"></span><span>    </span><span class="hs-comment">--  is cml_args, after popping any other junk from the stack.</span><span>
</span><span id="line-453"></span><span>    </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_cont :: CmmNode O C -&gt; Maybe BlockId
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066815"><span id="local-6989586621681066816"><span id="local-6989586621681066817"><span id="local-6989586621681066818"><span id="local-6989586621681066819"><span class="annot"><span class="annottext">ByteOff
[GlobalReg]
CmmExpr
cml_ret_off :: ByteOff
cml_ret_args :: ByteOff
cml_args :: ByteOff
cml_args_regs :: [GlobalReg]
cml_target :: CmmExpr
cml_ret_off :: CmmNode O C -&gt; ByteOff
cml_ret_args :: CmmNode O C -&gt; ByteOff
cml_args_regs :: CmmNode O C -&gt; [GlobalReg]
cml_args :: CmmNode O C -&gt; ByteOff
cml_target :: CmmNode O C -&gt; CmmExpr
</span><a href="#local-6989586621681066815"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-454"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066814"><span class="annot"><span class="annottext">sp_off :: ByteOff
</span><a href="#local-6989586621681066814"><span class="hs-identifier hs-var hs-var">sp_off</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066828"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066817"><span class="hs-identifier hs-var">cml_args</span></a></span><span>
</span><span id="line-455"></span><span>      </span><span class="annot"><span class="annottext">([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
 LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066814"><span class="hs-identifier hs-var">sp_off</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span>    </span><span class="hs-comment">--  At each CmmCall with a continuation:</span><span>
</span><span id="line-458"></span><span>    </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_cont :: CmmNode O C -&gt; Maybe BlockId
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066809"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066809"><span class="hs-identifier hs-var">cont_lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066804"><span id="local-6989586621681066805"><span id="local-6989586621681066806"><span id="local-6989586621681066807"><span id="local-6989586621681066808"><span class="annot"><span class="annottext">ByteOff
[GlobalReg]
CmmExpr
cml_ret_off :: ByteOff
cml_ret_args :: ByteOff
cml_args :: ByteOff
cml_args_regs :: [GlobalReg]
cml_target :: CmmExpr
cml_ret_off :: CmmNode O C -&gt; ByteOff
cml_ret_args :: CmmNode O C -&gt; ByteOff
cml_args_regs :: CmmNode O C -&gt; [GlobalReg]
cml_args :: CmmNode O C -&gt; ByteOff
cml_target :: CmmNode O C -&gt; CmmExpr
</span><a href="#local-6989586621681066804"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-459"></span><span>       </span><span class="annot"><span class="annottext">([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
 LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
  LabelMap StackMap)
 -&gt; UniqSM
      ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
       LabelMap StackMap))
-&gt; ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
    LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
-&gt; ByteOff
-&gt; ByteOff
-&gt; ByteOff
-&gt; ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
    LabelMap StackMap)
</span><a href="#local-6989586621681066803"><span class="hs-identifier hs-var">lastCall</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066809"><span class="hs-identifier hs-var">cont_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066806"><span class="hs-identifier hs-var">cml_args</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066805"><span class="hs-identifier hs-var">cml_ret_args</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066804"><span class="hs-identifier hs-var">cml_ret_off</span></a></span><span>
</span><span id="line-460"></span><span>
</span><span id="line-461"></span><span>    </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">succ :: CmmNode O C -&gt; BlockId
</span><a href="GHC.Cmm.Node.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681066799"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066799"><span class="hs-identifier hs-var">cont_lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066793"><span id="local-6989586621681066794"><span id="local-6989586621681066795"><span id="local-6989586621681066796"><span id="local-6989586621681066797"><span id="local-6989586621681066798"><span class="annot"><span class="annottext">Bool
ByteOff
[CmmExpr]
[LocalReg]
ForeignTarget
intrbl :: Bool
ret_off :: ByteOff
ret_args :: ByteOff
args :: [CmmExpr]
res :: [LocalReg]
tgt :: ForeignTarget
tgt :: CmmNode O C -&gt; ForeignTarget
ret_off :: CmmNode O C -&gt; ByteOff
ret_args :: CmmNode O C -&gt; ByteOff
res :: CmmNode O C -&gt; [LocalReg]
intrbl :: CmmNode O C -&gt; Bool
args :: CmmNode O C -&gt; [CmmExpr]
</span><a href="#local-6989586621681066793"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-462"></span><span>       </span><span class="annot"><span class="annottext">([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
 LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
  LabelMap StackMap)
 -&gt; UniqSM
      ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
       LabelMap StackMap))
-&gt; ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
    LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
-&gt; ByteOff
-&gt; ByteOff
-&gt; ByteOff
-&gt; ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
    LabelMap StackMap)
</span><a href="#local-6989586621681066803"><span class="hs-identifier hs-var">lastCall</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066799"><span class="hs-identifier hs-var">cont_lbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066791"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066795"><span class="hs-identifier hs-var">ret_args</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066794"><span class="hs-identifier hs-var">ret_off</span></a></span><span>
</span><span id="line-463"></span><span>            </span><span class="hs-comment">-- one word of args: the return address</span><span>
</span><span id="line-464"></span><span>
</span><span id="line-465"></span><span>    </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-type">CmmBranch</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="annot"><span class="annottext">UniqSM
  ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
   LabelMap StackMap)
</span><a href="#local-6989586621681066787"><span class="hs-identifier hs-var">handleBranches</span></a></span><span>
</span><span id="line-466"></span><span>    </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="annot"><span class="annottext">UniqSM
  ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
   LabelMap StackMap)
</span><a href="#local-6989586621681066787"><span class="hs-identifier hs-var">handleBranches</span></a></span><span>
</span><span id="line-467"></span><span>    </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-type">CmmSwitch</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="annot"><span class="annottext">UniqSM
  ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
   LabelMap StackMap)
</span><a href="#local-6989586621681066787"><span class="hs-identifier hs-var">handleBranches</span></a></span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-470"></span><span>     </span><span id="local-6989586621681066791"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681066791"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066834"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-471"></span><span>     </span><span class="hs-comment">-- Calls and ForeignCalls are handled the same way:</span><span>
</span><span id="line-472"></span><span>     </span><span class="annot"><a href="#local-6989586621681066803"><span class="hs-identifier hs-type">lastCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-473"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-474"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-475"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>
</span><span id="line-476"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-477"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>
</span><span id="line-478"></span><span>                 </span><span class="hs-special">)</span><span>
</span><span id="line-479"></span><span>     </span><span id="local-6989586621681066803"><span class="annot"><span class="annottext">lastCall :: BlockId
-&gt; ByteOff
-&gt; ByteOff
-&gt; ByteOff
-&gt; ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
    LabelMap StackMap)
</span><a href="#local-6989586621681066803"><span class="hs-identifier hs-var hs-var">lastCall</span></a></span></span><span> </span><span id="local-6989586621681066779"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066779"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681066778"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066778"><span class="hs-identifier hs-var">cml_args</span></a></span></span><span> </span><span id="local-6989586621681066777"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066777"><span class="hs-identifier hs-var">cml_ret_args</span></a></span></span><span> </span><span id="local-6989586621681066776"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066776"><span class="hs-identifier hs-var">cml_ret_off</span></a></span></span><span>
</span><span id="line-480"></span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066775"><span class="hs-identifier hs-var">assignments</span></a></span><span>
</span><span id="line-481"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; StackMap -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#spOffsetForCall"><span class="hs-identifier hs-var">spOffsetForCall</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066828"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066773"><span class="hs-identifier hs-var">cont_stack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066778"><span class="hs-identifier hs-var">cml_args</span></a></span><span>
</span><span id="line-482"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-483"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- no new blocks</span><span>
</span><span id="line-484"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; StackMap -&gt; LabelMap StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSingleton"><span class="hs-identifier hs-var">mapSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066779"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066773"><span class="hs-identifier hs-var">cont_stack</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-486"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621681066775"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066775"><span class="hs-identifier hs-var">assignments</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066773"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066773"><span class="hs-identifier hs-var">cont_stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; ByteOff -&gt; ByteOff -&gt; ([CmmNode O O], StackMap)
</span><a href="#local-6989586621681066772"><span class="hs-identifier hs-var">prepareStack</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066779"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066777"><span class="hs-identifier hs-var">cml_ret_args</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066776"><span class="hs-identifier hs-var">cml_ret_off</span></a></span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span>
</span><span id="line-489"></span><span>     </span><span id="local-6989586621681066772"><span class="annot"><span class="annottext">prepareStack :: BlockId -&gt; ByteOff -&gt; ByteOff -&gt; ([CmmNode O O], StackMap)
</span><a href="#local-6989586621681066772"><span class="hs-identifier hs-var hs-var">prepareStack</span></a></span></span><span> </span><span id="local-6989586621681066771"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066771"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681066770"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066770"><span class="hs-identifier hs-var">cml_ret_args</span></a></span></span><span> </span><span id="local-6989586621681066769"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066769"><span class="hs-identifier hs-var">cml_ret_off</span></a></span></span><span>
</span><span id="line-490"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066768"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066768"><span class="hs-identifier hs-var">cont_stack</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap StackMap -&gt; Maybe StackMap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066771"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066830"><span class="hs-identifier hs-var">stackmaps</span></a></span><span>
</span><span id="line-491"></span><span>             </span><span class="hs-comment">-- If we have already seen this continuation before, then</span><span>
</span><span id="line-492"></span><span>             </span><span class="hs-comment">-- we just have to make the stack look the same:</span><span>
</span><span id="line-493"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; StackMap -&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#fixupStack"><span class="hs-identifier hs-var">fixupStack</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066768"><span class="hs-identifier hs-var">cont_stack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066768"><span class="hs-identifier hs-var">cont_stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span>             </span><span class="hs-comment">-- Otherwise, we have to allocate the stack frame</span><span>
</span><span id="line-495"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-496"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066766"><span class="hs-identifier hs-var">save_assignments</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066765"><span class="hs-identifier hs-var">new_cont_stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-497"></span><span>       </span><span class="hs-keyword">where</span><span>
</span><span id="line-498"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681066765"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066765"><span class="hs-identifier hs-var">new_cont_stack</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066766"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066766"><span class="hs-identifier hs-var">save_assignments</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-499"></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform
-&gt; BlockId
-&gt; BlockEntryLiveness LocalReg
-&gt; ByteOff
-&gt; ByteOff
-&gt; StackMap
-&gt; (StackMap, [CmmNode O O])
</span><a href="GHC.Cmm.LayoutStack.html#setupStackFrame"><span class="hs-identifier hs-var">setupStackFrame</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066791"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066771"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066832"><span class="hs-identifier hs-var">liveness</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066769"><span class="hs-identifier hs-var">cml_ret_off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066770"><span class="hs-identifier hs-var">cml_ret_args</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span>
</span><span id="line-502"></span><span>     </span><span class="hs-comment">-- For other last nodes (branches), if any of the targets is a</span><span>
</span><span id="line-503"></span><span>     </span><span class="hs-comment">-- proc point, we have to set up the stack to match what the proc</span><span>
</span><span id="line-504"></span><span>     </span><span class="hs-comment">-- point is expecting.</span><span>
</span><span id="line-505"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-506"></span><span>     </span><span class="annot"><a href="#local-6989586621681066787"><span class="hs-identifier hs-type">handleBranches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-507"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-508"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>
</span><span id="line-509"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-510"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-511"></span><span>
</span><span id="line-512"></span><span>     </span><span id="local-6989586621681066787"><span class="annot"><span class="annottext">handleBranches :: UniqSM
  ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
   LabelMap StackMap)
</span><a href="#local-6989586621681066787"><span class="hs-identifier hs-var hs-var">handleBranches</span></a></span></span><span>
</span><span id="line-513"></span><span>         </span><span class="hs-comment">-- Note [diamond proc point]</span><span>
</span><span id="line-514"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066763"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066763"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; Maybe BlockId
</span><a href="GHC.Cmm.LayoutStack.html#futureContinuation"><span class="hs-identifier hs-var">futureContinuation</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066826"><span class="hs-identifier hs-var">middle</span></a></span><span>
</span><span id="line-515"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[BlockId] -&gt; [BlockId]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">([BlockId] -&gt; [BlockId]) -&gt; [BlockId] -&gt; [BlockId]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; Bool) -&gt; [BlockId] -&gt; [BlockId]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-operator hs-var">`setMember`</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066833"><span class="hs-identifier hs-var">procpoints</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([BlockId] -&gt; [BlockId]) -&gt; [BlockId] -&gt; [BlockId]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; [BlockId]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [BlockId]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[BlockId] -&gt; [BlockId] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066763"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-516"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-517"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066759"><span class="annot"><span class="annottext">cont_args :: ByteOff
</span><a href="#local-6989586621681066759"><span class="hs-identifier hs-var hs-var">cont_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; KeyOf LabelMap -&gt; LabelMap ByteOff -&gt; ByteOff
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066763"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap ByteOff
</span><a href="#local-6989586621681066831"><span class="hs-identifier hs-var">cont_info</span></a></span><span>
</span><span id="line-518"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681066758"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066758"><span class="hs-identifier hs-var">assigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066757"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066757"><span class="hs-identifier hs-var">cont_stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; ByteOff -&gt; ByteOff -&gt; ([CmmNode O O], StackMap)
</span><a href="#local-6989586621681066772"><span class="hs-identifier hs-var">prepareStack</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066763"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066759"><span class="hs-identifier hs-var">cont_args</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_ret_off"><span class="hs-identifier hs-var hs-var">sm_ret_off</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-519"></span><span>             </span><span id="local-6989586621681066756"><span class="annot"><span class="annottext">out :: LabelMap StackMap
</span><a href="#local-6989586621681066756"><span class="hs-identifier hs-var hs-var">out</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, StackMap)] -&gt; LabelMap StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066755"><span class="hs-identifier hs-var">l'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066757"><span class="hs-identifier hs-var">cont_stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-520"></span><span>                               </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681066755"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066755"><span class="hs-identifier hs-var">l'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; [BlockId]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [BlockId]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-521"></span><span>         </span><span class="annot"><span class="annottext">([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
 LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066758"><span class="hs-identifier hs-var">assigs</span></a></span><span>
</span><span id="line-522"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; StackMap -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#spOffsetForCall"><span class="hs-identifier hs-var">spOffsetForCall</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066828"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066757"><span class="hs-identifier hs-var">cont_stack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066791"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-523"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-524"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-525"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066756"><span class="hs-identifier hs-var">out</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-526"></span><span>
</span><span id="line-527"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-528"></span><span>          </span><span id="local-6989586621681066754"><span class="annot"><span class="annottext">[(BlockId, BlockId, StackMap, [CmmBlock])]
</span><a href="#local-6989586621681066754"><span class="hs-identifier hs-var">pps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; UniqSM (BlockId, BlockId, StackMap, [CmmBlock]))
-&gt; [BlockId] -&gt; UniqSM [(BlockId, BlockId, StackMap, [CmmBlock])]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; UniqSM (BlockId, BlockId, StackMap, [CmmBlock])
</span><a href="#local-6989586621681066753"><span class="hs-identifier hs-var">handleBranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O C -&gt; [BlockId]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [BlockId]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-529"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681066752"><span class="hs-identifier hs-type">lbl_map</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span>
</span><span id="line-530"></span><span>              </span><span id="local-6989586621681066752"><span class="annot"><span class="annottext">lbl_map :: LabelMap BlockId
</span><a href="#local-6989586621681066752"><span class="hs-identifier hs-var hs-var">lbl_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, BlockId)] -&gt; LabelMap BlockId
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066751"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066750"><span class="hs-identifier hs-var">tmp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066751"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066751"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681066750"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066750"><span class="hs-identifier hs-var">tmp</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">StackMap
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[CmmBlock]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(BlockId, BlockId, StackMap, [CmmBlock])]
</span><a href="#local-6989586621681066754"><span class="hs-identifier hs-var">pps</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-531"></span><span>              </span><span id="local-6989586621681066748"><span class="annot"><span class="annottext">fix_lbl :: BlockId -&gt; BlockId
</span><a href="#local-6989586621681066748"><span class="hs-identifier hs-var hs-var">fix_lbl</span></a></span></span><span> </span><span id="local-6989586621681066747"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066747"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; KeyOf LabelMap -&gt; LabelMap BlockId -&gt; BlockId
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066747"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066747"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681066752"><span class="hs-identifier hs-var">lbl_map</span></a></span><span>
</span><span id="line-532"></span><span>          </span><span class="annot"><span class="annottext">([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
 LabelMap StackMap)
-&gt; UniqSM
     ([CmmNode O O], ByteOff, CmmNode O C, [CmmBlock],
      LabelMap StackMap)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-533"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-534"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; BlockId) -&gt; CmmNode O C -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#mapSuccessors"><span class="hs-identifier hs-var">mapSuccessors</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId
</span><a href="#local-6989586621681066748"><span class="hs-identifier hs-var">fix_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066825"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-535"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[[CmmBlock]] -&gt; [CmmBlock]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066744"><span class="hs-identifier hs-var">blk</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">StackMap
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681066744"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066744"><span class="hs-identifier hs-var">blk</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(BlockId, BlockId, StackMap, [CmmBlock])]
</span><a href="#local-6989586621681066754"><span class="hs-identifier hs-var">pps</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-536"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, StackMap)] -&gt; LabelMap StackMap
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066743"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066742"><span class="hs-identifier hs-var">sm</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066743"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066743"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681066742"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066742"><span class="hs-identifier hs-var">sm</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[CmmBlock]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(BlockId, BlockId, StackMap, [CmmBlock])]
</span><a href="#local-6989586621681066754"><span class="hs-identifier hs-var">pps</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span>     </span><span class="hs-comment">-- For each successor of this block</span><span>
</span><span id="line-539"></span><span>     </span><span class="annot"><a href="#local-6989586621681066753"><span class="hs-identifier hs-type">handleBranch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>     </span><span id="local-6989586621681066753"><span class="annot"><span class="annottext">handleBranch :: BlockId -&gt; UniqSM (BlockId, BlockId, StackMap, [CmmBlock])
</span><a href="#local-6989586621681066753"><span class="hs-identifier hs-var hs-var">handleBranch</span></a></span></span><span> </span><span id="local-6989586621681066741"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span></span><span>
</span><span id="line-541"></span><span>        </span><span class="hs-comment">--   (a) if the successor already has a stackmap, we need to</span><span>
</span><span id="line-542"></span><span>        </span><span class="hs-comment">--       shuffle the current stack to make it look the same.</span><span>
</span><span id="line-543"></span><span>        </span><span class="hs-comment">--       We have to insert a new block to make this happen.</span><span>
</span><span id="line-544"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066740"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066740"><span class="hs-identifier hs-var">stack2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap StackMap -&gt; Maybe StackMap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066830"><span class="hs-identifier hs-var">stackmaps</span></a></span><span>
</span><span id="line-545"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-546"></span><span>             </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066739"><span class="annot"><span class="annottext">assigs :: [CmmNode O O]
</span><a href="#local-6989586621681066739"><span class="hs-identifier hs-var hs-var">assigs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; StackMap -&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#fixupStack"><span class="hs-identifier hs-var">fixupStack</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066740"><span class="hs-identifier hs-var">stack2</span></a></span><span>
</span><span id="line-547"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681066738"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066738"><span class="hs-identifier hs-var">tmp_lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066737"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066737"><span class="hs-identifier hs-var">block</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; ByteOff
-&gt; BlockId
-&gt; StackMap
-&gt; CmmTickScope
-&gt; [CmmNode O O]
-&gt; UniqSM (BlockId, [CmmBlock])
</span><a href="GHC.Cmm.LayoutStack.html#makeFixupBlock"><span class="hs-identifier hs-var">makeFixupBlock</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066834"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066828"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066740"><span class="hs-identifier hs-var">stack2</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066827"><span class="hs-identifier hs-var">tscp</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066739"><span class="hs-identifier hs-var">assigs</span></a></span><span>
</span><span id="line-548"></span><span>             </span><span class="annot"><span class="annottext">(BlockId, BlockId, StackMap, [CmmBlock])
-&gt; UniqSM (BlockId, BlockId, StackMap, [CmmBlock])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066738"><span class="hs-identifier hs-var">tmp_lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066740"><span class="hs-identifier hs-var">stack2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066737"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-549"></span><span>
</span><span id="line-550"></span><span>        </span><span class="hs-comment">--   (b) if the successor is a proc point, save everything</span><span>
</span><span id="line-551"></span><span>        </span><span class="hs-comment">--       on the stack.</span><span>
</span><span id="line-552"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-operator hs-var">`setMember`</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066833"><span class="hs-identifier hs-var">procpoints</span></a></span><span>
</span><span id="line-553"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-554"></span><span>             </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066735"><span class="annot"><span class="annottext">cont_args :: ByteOff
</span><a href="#local-6989586621681066735"><span class="hs-identifier hs-var hs-var">cont_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; KeyOf LabelMap -&gt; LabelMap ByteOff -&gt; ByteOff
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap ByteOff
</span><a href="#local-6989586621681066831"><span class="hs-identifier hs-var">cont_info</span></a></span><span>
</span><span id="line-555"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681066734"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066734"><span class="hs-identifier hs-var">stack2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066733"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066733"><span class="hs-identifier hs-var">assigs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-556"></span><span>                      </span><span class="annot"><span class="annottext">Platform
-&gt; BlockId
-&gt; BlockEntryLiveness LocalReg
-&gt; ByteOff
-&gt; ByteOff
-&gt; StackMap
-&gt; (StackMap, [CmmNode O O])
</span><a href="GHC.Cmm.LayoutStack.html#setupStackFrame"><span class="hs-identifier hs-var">setupStackFrame</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066791"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066832"><span class="hs-identifier hs-var">liveness</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_ret_off"><span class="hs-identifier hs-var hs-var">sm_ret_off</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-557"></span><span>                                                        </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066735"><span class="hs-identifier hs-var">cont_args</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span>
</span><span id="line-558"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681066732"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066732"><span class="hs-identifier hs-var">tmp_lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066731"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066731"><span class="hs-identifier hs-var">block</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; ByteOff
-&gt; BlockId
-&gt; StackMap
-&gt; CmmTickScope
-&gt; [CmmNode O O]
-&gt; UniqSM (BlockId, [CmmBlock])
</span><a href="GHC.Cmm.LayoutStack.html#makeFixupBlock"><span class="hs-identifier hs-var">makeFixupBlock</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066834"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066828"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066734"><span class="hs-identifier hs-var">stack2</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066827"><span class="hs-identifier hs-var">tscp</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066733"><span class="hs-identifier hs-var">assigs</span></a></span><span>
</span><span id="line-559"></span><span>             </span><span class="annot"><span class="annottext">(BlockId, BlockId, StackMap, [CmmBlock])
-&gt; UniqSM (BlockId, BlockId, StackMap, [CmmBlock])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066732"><span class="hs-identifier hs-var">tmp_lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066734"><span class="hs-identifier hs-var">stack2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066731"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span>        </span><span class="hs-comment">--   (c) otherwise, the current StackMap is the StackMap for</span><span>
</span><span id="line-562"></span><span>        </span><span class="hs-comment">--       the continuation.  But we must remember to remove any</span><span>
</span><span id="line-563"></span><span>        </span><span class="hs-comment">--       variables from the StackMap that are *not* live at</span><span>
</span><span id="line-564"></span><span>        </span><span class="hs-comment">--       the destination, because this StackMap might be used</span><span>
</span><span id="line-565"></span><span>        </span><span class="hs-comment">--       by fixupStack if this is a join point.</span><span>
</span><span id="line-566"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BlockId, BlockId, StackMap, [CmmBlock])
-&gt; UniqSM (BlockId, BlockId, StackMap, [CmmBlock])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066730"><span class="hs-identifier hs-var">stack1</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066729"><span class="annot"><span class="annottext">live :: CmmLocalLive
</span><a href="#local-6989586621681066729"><span class="hs-identifier hs-var hs-var">live</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
-&gt; KeyOf LabelMap -&gt; BlockEntryLiveness LocalReg -&gt; CmmLocalLive
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; CmmLocalLive
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;handleBranch&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066832"><span class="hs-identifier hs-var">liveness</span></a></span><span>
</span><span id="line-568"></span><span>              </span><span id="local-6989586621681066730"><span class="annot"><span class="annottext">stack1 :: StackMap
</span><a href="#local-6989586621681066730"><span class="hs-identifier hs-var hs-var">stack1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((LocalReg, ByteOff) -&gt; Bool)
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
forall elt key. (elt -&gt; Bool) -&gt; UniqFM key elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#filterUFM"><span class="hs-identifier hs-var">filterUFM</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, ByteOff) -&gt; Bool
</span><a href="#local-6989586621681066726"><span class="hs-identifier hs-var">is_live</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066829"><span class="hs-identifier hs-var">stack0</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-569"></span><span>              </span><span id="local-6989586621681066726"><span class="annot"><span class="annottext">is_live :: (LocalReg, ByteOff) -&gt; Bool
</span><a href="#local-6989586621681066726"><span class="hs-identifier hs-var hs-var">is_live</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066725"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066725"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066725"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; CmmLocalLive -&gt; Bool
forall r. Ord r =&gt; r -&gt; RegSet r -&gt; Bool
</span><a href="GHC.Cmm.Expr.html#elemRegSet"><span class="hs-operator hs-var">`elemRegSet`</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066729"><span class="hs-identifier hs-var">live</span></a></span><span>
</span><span id="line-570"></span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#makeFixupBlock"><span class="hs-identifier hs-type">makeFixupBlock</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>
</span><span id="line-573"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmTickScope"><span class="hs-identifier hs-type">CmmTickScope</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-574"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-575"></span><span id="makeFixupBlock"><span class="annot"><span class="annottext">makeFixupBlock :: DynFlags
-&gt; ByteOff
-&gt; BlockId
-&gt; StackMap
-&gt; CmmTickScope
-&gt; [CmmNode O O]
-&gt; UniqSM (BlockId, [CmmBlock])
</span><a href="GHC.Cmm.LayoutStack.html#makeFixupBlock"><span class="hs-identifier hs-var hs-var">makeFixupBlock</span></a></span></span><span> </span><span id="local-6989586621681066723"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066723"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066722"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066722"><span class="hs-identifier hs-var">sp0</span></a></span></span><span> </span><span id="local-6989586621681066721"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066721"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681066720"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066720"><span class="hs-identifier hs-var">stack</span></a></span></span><span> </span><span id="local-6989586621681066719"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066719"><span class="hs-identifier hs-var">tscope</span></a></span></span><span> </span><span id="local-6989586621681066718"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066718"><span class="hs-identifier hs-var">assigs</span></a></span></span><span>
</span><span id="line-576"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066718"><span class="hs-identifier hs-var">assigs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066722"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066720"><span class="hs-identifier hs-var">stack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BlockId, [CmmBlock]) -&gt; UniqSM (BlockId, [CmmBlock])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066721"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-578"></span><span>    </span><span id="local-6989586621681066715"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066715"><span class="hs-identifier hs-var">tmp_lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqSM BlockId
forall (m :: * -&gt; *). MonadUnique m =&gt; m BlockId
</span><a href="GHC.Cmm.BlockId.html#newBlockId"><span class="hs-identifier hs-var">newBlockId</span></a></span><span>
</span><span id="line-579"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066713"><span class="annot"><span class="annottext">sp_off :: ByteOff
</span><a href="#local-6989586621681066713"><span class="hs-identifier hs-var hs-var">sp_off</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066722"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066720"><span class="hs-identifier hs-var">stack</span></a></span><span>
</span><span id="line-580"></span><span>        </span><span id="local-6989586621681066712"><span class="annot"><span class="annottext">block :: CmmBlock
</span><a href="#local-6989586621681066712"><span class="hs-identifier hs-var hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode C O -&gt; Block CmmNode O O -&gt; CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
n C O -&gt; Block n O O -&gt; n O C -&gt; Block n C C
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoin"><span class="hs-identifier hs-var">blockJoin</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmNode C O
</span><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-var">CmmEntry</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066715"><span class="hs-identifier hs-var">tmp_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066719"><span class="hs-identifier hs-var">tscope</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-581"></span><span>                          </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; ByteOff -&gt; ByteOff -&gt; Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#maybeAddSpAdj"><span class="hs-identifier hs-var">maybeAddSpAdj</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066723"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066722"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066713"><span class="hs-identifier hs-var">sp_off</span></a></span><span>
</span><span id="line-582"></span><span>                           </span><span class="annot"><span class="annottext">(Block CmmNode O O -&gt; Block CmmNode O O)
-&gt; Block CmmNode O O -&gt; Block CmmNode O O
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O] -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
[n O O] -&gt; Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#blockFromList"><span class="hs-identifier hs-var">blockFromList</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066718"><span class="hs-identifier hs-var">assigs</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066721"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span>    </span><span class="annot"><span class="annottext">(BlockId, [CmmBlock]) -&gt; UniqSM (BlockId, [CmmBlock])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066715"><span class="hs-identifier hs-var">tmp_lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066712"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span>
</span><span id="line-587"></span><span class="hs-comment">-- Sp is currently pointing to current_sp,</span><span>
</span><span id="line-588"></span><span class="hs-comment">-- we want it to point to</span><span>
</span><span id="line-589"></span><span class="hs-comment">--    (sm_sp cont_stack - sm_args cont_stack + args)</span><span>
</span><span id="line-590"></span><span class="hs-comment">-- so the difference is</span><span>
</span><span id="line-591"></span><span class="hs-comment">--    sp0 - (sm_sp cont_stack - sm_args cont_stack + args)</span><span>
</span><span id="line-592"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#spOffsetForCall"><span class="hs-identifier hs-type">spOffsetForCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-593"></span><span id="spOffsetForCall"><span class="annot"><span class="annottext">spOffsetForCall :: ByteOff -&gt; StackMap -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#spOffsetForCall"><span class="hs-identifier hs-var hs-var">spOffsetForCall</span></a></span></span><span> </span><span id="local-6989586621681066708"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066708"><span class="hs-identifier hs-var">current_sp</span></a></span></span><span> </span><span id="local-6989586621681066707"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066707"><span class="hs-identifier hs-var">cont_stack</span></a></span></span><span> </span><span id="local-6989586621681066706"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066706"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-594"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066708"><span class="hs-identifier hs-var">current_sp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066707"><span class="hs-identifier hs-var">cont_stack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_args"><span class="hs-identifier hs-var hs-var">sm_args</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066707"><span class="hs-identifier hs-var">cont_stack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066706"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span class="hs-comment">-- | create a sequence of assignments to establish the new StackMap,</span><span>
</span><span id="line-598"></span><span class="hs-comment">-- given the old StackMap.</span><span>
</span><span id="line-599"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#fixupStack"><span class="hs-identifier hs-type">fixupStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-600"></span><span id="fixupStack"><span class="annot"><span class="annottext">fixupStack :: StackMap -&gt; StackMap -&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#fixupStack"><span class="hs-identifier hs-var hs-var">fixupStack</span></a></span></span><span> </span><span id="local-6989586621681066705"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066705"><span class="hs-identifier hs-var">old_stack</span></a></span></span><span> </span><span id="local-6989586621681066704"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066704"><span class="hs-identifier hs-var">new_stack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((LocalReg, ByteOff) -&gt; [CmmNode O O])
-&gt; [(LocalReg, ByteOff)] -&gt; [CmmNode O O]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg, ByteOff) -&gt; [CmmNode O O]
</span><a href="#local-6989586621681066702"><span class="hs-identifier hs-var">move</span></a></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, ByteOff)]
</span><a href="#local-6989586621681066701"><span class="hs-identifier hs-var">new_locs</span></a></span><span>
</span><span id="line-601"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-602"></span><span>     </span><span id="local-6989586621681066700"><span class="annot"><span class="annottext">old_map :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066700"><span class="hs-identifier hs-var hs-var">old_map</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066705"><span class="hs-identifier hs-var">old_stack</span></a></span><span>
</span><span id="line-603"></span><span>     </span><span id="local-6989586621681066701"><span class="annot"><span class="annottext">new_locs :: [(LocalReg, ByteOff)]
</span><a href="#local-6989586621681066701"><span class="hs-identifier hs-var hs-var">new_locs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; [(LocalReg, ByteOff)]
</span><a href="GHC.Cmm.LayoutStack.html#stackSlotRegs"><span class="hs-identifier hs-var">stackSlotRegs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066704"><span class="hs-identifier hs-var">new_stack</span></a></span><span>
</span><span id="line-604"></span><span>
</span><span id="line-605"></span><span>     </span><span id="local-6989586621681066702"><span class="annot"><span class="annottext">move :: (LocalReg, ByteOff) -&gt; [CmmNode O O]
</span><a href="#local-6989586621681066702"><span class="hs-identifier hs-var hs-var">move</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066698"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066698"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681066697"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066697"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681066696"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066696"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; LocalReg -&gt; Maybe (LocalReg, ByteOff)
forall key elt. Uniquable key =&gt; UniqFM key elt -&gt; key -&gt; Maybe elt
</span><a href="GHC.Types.Unique.FM.html#lookupUFM"><span class="hs-identifier hs-var">lookupUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066700"><span class="hs-identifier hs-var">old_map</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066698"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066697"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066696"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-607"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmStore"><span class="hs-identifier hs-var">CmmStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Area -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-var">CmmStackSlot</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="GHC.Cmm.Expr.html#Old"><span class="hs-identifier hs-var">Old</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066697"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-608"></span><span>                               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066698"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span>
</span><span id="line-611"></span><span>
</span><span id="line-612"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#setupStackFrame"><span class="hs-identifier hs-type">setupStackFrame</span></a></span><span>
</span><span id="line-613"></span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span>
</span><span id="line-614"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>                 </span><span class="hs-comment">-- label of continuation</span><span>
</span><span id="line-615"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html#CmmLocalLive"><span class="hs-identifier hs-type">CmmLocalLive</span></a></span><span>   </span><span class="hs-comment">-- liveness</span><span>
</span><span id="line-616"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>      </span><span class="hs-comment">-- updfr</span><span>
</span><span id="line-617"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>      </span><span class="hs-comment">-- bytes of return values on stack</span><span>
</span><span id="line-618"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>     </span><span class="hs-comment">-- current StackMap</span><span>
</span><span id="line-619"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-620"></span><span>
</span><span id="line-621"></span><span id="setupStackFrame"><span class="annot"><span class="annottext">setupStackFrame :: Platform
-&gt; BlockId
-&gt; BlockEntryLiveness LocalReg
-&gt; ByteOff
-&gt; ByteOff
-&gt; StackMap
-&gt; (StackMap, [CmmNode O O])
</span><a href="GHC.Cmm.LayoutStack.html#setupStackFrame"><span class="hs-identifier hs-var hs-var">setupStackFrame</span></a></span></span><span> </span><span id="local-6989586621681066693"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066693"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066692"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066692"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681066691"><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066691"><span class="hs-identifier hs-var">liveness</span></a></span></span><span> </span><span id="local-6989586621681066690"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066690"><span class="hs-identifier hs-var">updfr_off</span></a></span></span><span> </span><span id="local-6989586621681066689"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066689"><span class="hs-identifier hs-var">ret_args</span></a></span></span><span> </span><span id="local-6989586621681066688"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066688"><span class="hs-identifier hs-var">stack0</span></a></span></span><span>
</span><span id="line-622"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066687"><span class="hs-identifier hs-var">cont_stack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066686"><span class="hs-identifier hs-var">assignments</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-623"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-624"></span><span>      </span><span class="hs-comment">-- get the set of LocalRegs live in the continuation</span><span>
</span><span id="line-625"></span><span>      </span><span id="local-6989586621681066685"><span class="annot"><span class="annottext">live :: CmmLocalLive
</span><a href="#local-6989586621681066685"><span class="hs-identifier hs-var hs-var">live</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
-&gt; KeyOf LabelMap -&gt; BlockEntryLiveness LocalReg -&gt; CmmLocalLive
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">Set.empty</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066692"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066691"><span class="hs-identifier hs-var">liveness</span></a></span><span>
</span><span id="line-626"></span><span>
</span><span id="line-627"></span><span>      </span><span class="hs-comment">-- the stack from the base to updfr_off is off-limits.</span><span>
</span><span id="line-628"></span><span>      </span><span class="hs-comment">-- our new stack frame contains:</span><span>
</span><span id="line-629"></span><span>      </span><span class="hs-comment">--   * saved live variables</span><span>
</span><span id="line-630"></span><span>      </span><span class="hs-comment">--   * the return address [young(C) + 8]</span><span>
</span><span id="line-631"></span><span>      </span><span class="hs-comment">--   * the args for the call,</span><span>
</span><span id="line-632"></span><span>      </span><span class="hs-comment">--     which are replaced by the return values at the return</span><span>
</span><span id="line-633"></span><span>      </span><span class="hs-comment">--     point.</span><span>
</span><span id="line-634"></span><span>
</span><span id="line-635"></span><span>      </span><span class="hs-comment">-- everything up to updfr_off is off-limits</span><span>
</span><span id="line-636"></span><span>      </span><span class="hs-comment">-- stack1 contains updfr_off, plus everything we need to save</span><span>
</span><span id="line-637"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681066683"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066683"><span class="hs-identifier hs-var">stack1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066686"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066686"><span class="hs-identifier hs-var">assignments</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform
-&gt; ByteOff -&gt; CmmLocalLive -&gt; StackMap -&gt; (StackMap, [CmmNode O O])
</span><a href="GHC.Cmm.LayoutStack.html#allocate"><span class="hs-identifier hs-var">allocate</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066693"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066690"><span class="hs-identifier hs-var">updfr_off</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066685"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066688"><span class="hs-identifier hs-var">stack0</span></a></span><span>
</span><span id="line-638"></span><span>
</span><span id="line-639"></span><span>      </span><span class="hs-comment">-- And the Sp at the continuation is:</span><span>
</span><span id="line-640"></span><span>      </span><span class="hs-comment">--   sm_sp stack1 + ret_args</span><span>
</span><span id="line-641"></span><span>      </span><span id="local-6989586621681066687"><span class="annot"><span class="annottext">cont_stack :: StackMap
</span><a href="#local-6989586621681066687"><span class="hs-identifier hs-var hs-var">cont_stack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066683"><span class="hs-identifier hs-var">stack1</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_sp :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066683"><span class="hs-identifier hs-var">stack1</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066689"><span class="hs-identifier hs-var">ret_args</span></a></span><span>
</span><span id="line-642"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_args :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_args"><span class="hs-identifier hs-var">sm_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066689"><span class="hs-identifier hs-var">ret_args</span></a></span><span>
</span><span id="line-643"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_ret_off :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_ret_off"><span class="hs-identifier hs-var">sm_ret_off</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066690"><span class="hs-identifier hs-var">updfr_off</span></a></span><span>
</span><span id="line-644"></span><span>                         </span><span class="hs-special">}</span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span>
</span><span id="line-647"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-648"></span><span class="hs-comment">-- Note [diamond proc point]</span><span>
</span><span id="line-649"></span><span class="hs-comment">--</span><span>
</span><span id="line-650"></span><span class="hs-comment">-- This special case looks for the pattern we get from a typical</span><span>
</span><span id="line-651"></span><span class="hs-comment">-- tagged case expression:</span><span>
</span><span id="line-652"></span><span class="hs-comment">--</span><span>
</span><span id="line-653"></span><span class="hs-comment">--    Sp[young(L1)] = L1</span><span>
</span><span id="line-654"></span><span class="hs-comment">--    if (R1 &amp; 7) != 0 goto L1 else goto L2</span><span>
</span><span id="line-655"></span><span class="hs-comment">--  L2:</span><span>
</span><span id="line-656"></span><span class="hs-comment">--    call [R1] returns to L1</span><span>
</span><span id="line-657"></span><span class="hs-comment">--  L1: live: {y}</span><span>
</span><span id="line-658"></span><span class="hs-comment">--    x = R1</span><span>
</span><span id="line-659"></span><span class="hs-comment">--</span><span>
</span><span id="line-660"></span><span class="hs-comment">-- If we let the generic case handle this, we get</span><span>
</span><span id="line-661"></span><span class="hs-comment">--</span><span>
</span><span id="line-662"></span><span class="hs-comment">--    Sp[-16] = L1</span><span>
</span><span id="line-663"></span><span class="hs-comment">--    if (R1 &amp; 7) != 0 goto L1a else goto L2</span><span>
</span><span id="line-664"></span><span class="hs-comment">--  L2:</span><span>
</span><span id="line-665"></span><span class="hs-comment">--    Sp[-8] = y</span><span>
</span><span id="line-666"></span><span class="hs-comment">--    Sp = Sp - 16</span><span>
</span><span id="line-667"></span><span class="hs-comment">--    call [R1] returns to L1</span><span>
</span><span id="line-668"></span><span class="hs-comment">--  L1a:</span><span>
</span><span id="line-669"></span><span class="hs-comment">--    Sp[-8] = y</span><span>
</span><span id="line-670"></span><span class="hs-comment">--    Sp = Sp - 16</span><span>
</span><span id="line-671"></span><span class="hs-comment">--    goto L1</span><span>
</span><span id="line-672"></span><span class="hs-comment">--  L1:</span><span>
</span><span id="line-673"></span><span class="hs-comment">--    x = R1</span><span>
</span><span id="line-674"></span><span class="hs-comment">--</span><span>
</span><span id="line-675"></span><span class="hs-comment">-- The code for saving the live vars is duplicated in each branch, and</span><span>
</span><span id="line-676"></span><span class="hs-comment">-- furthermore there is an extra jump in the fast path (assuming L1 is</span><span>
</span><span id="line-677"></span><span class="hs-comment">-- a proc point, which it probably is if there is a heap check).</span><span>
</span><span id="line-678"></span><span class="hs-comment">--</span><span>
</span><span id="line-679"></span><span class="hs-comment">-- So to fix this we want to set up the stack frame before the</span><span>
</span><span id="line-680"></span><span class="hs-comment">-- conditional jump.  How do we know when to do this, and when it is</span><span>
</span><span id="line-681"></span><span class="hs-comment">-- safe?  The basic idea is, when we see the assignment</span><span>
</span><span id="line-682"></span><span class="hs-comment">--</span><span>
</span><span id="line-683"></span><span class="hs-comment">--   Sp[young(L)] = L</span><span>
</span><span id="line-684"></span><span class="hs-comment">--</span><span>
</span><span id="line-685"></span><span class="hs-comment">-- we know that</span><span>
</span><span id="line-686"></span><span class="hs-comment">--   * we are definitely heading for L</span><span>
</span><span id="line-687"></span><span class="hs-comment">--   * there can be no more reads from another stack area, because young(L)</span><span>
</span><span id="line-688"></span><span class="hs-comment">--     overlaps with it.</span><span>
</span><span id="line-689"></span><span class="hs-comment">--</span><span>
</span><span id="line-690"></span><span class="hs-comment">-- We don't necessarily know that everything live at L is live now</span><span>
</span><span id="line-691"></span><span class="hs-comment">-- (some might be assigned between here and the jump to L).  So we</span><span>
</span><span id="line-692"></span><span class="hs-comment">-- simplify and only do the optimisation when we see</span><span>
</span><span id="line-693"></span><span class="hs-comment">--</span><span>
</span><span id="line-694"></span><span class="hs-comment">--   (1) a block containing an assignment of a return address L</span><span>
</span><span id="line-695"></span><span class="hs-comment">--   (2) ending in a branch where one (and only) continuation goes to L,</span><span>
</span><span id="line-696"></span><span class="hs-comment">--       and no other continuations go to proc points.</span><span>
</span><span id="line-697"></span><span class="hs-comment">--</span><span>
</span><span id="line-698"></span><span class="hs-comment">-- then we allocate the stack frame for L at the end of the block,</span><span>
</span><span id="line-699"></span><span class="hs-comment">-- before the branch.</span><span>
</span><span id="line-700"></span><span class="hs-comment">--</span><span>
</span><span id="line-701"></span><span class="hs-comment">-- We could generalise (2), but that would make it a bit more</span><span>
</span><span id="line-702"></span><span class="hs-comment">-- complicated to handle, and this currently catches the common case.</span><span>
</span><span id="line-703"></span><span>
</span><span id="line-704"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#futureContinuation"><span class="hs-identifier hs-type">futureContinuation</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-705"></span><span id="futureContinuation"><span class="annot"><span class="annottext">futureContinuation :: Block CmmNode O O -&gt; Maybe BlockId
</span><a href="GHC.Cmm.LayoutStack.html#futureContinuation"><span class="hs-identifier hs-var hs-var">futureContinuation</span></a></span></span><span> </span><span id="local-6989586621681066681"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066681"><span class="hs-identifier hs-var">middle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall (e :: Extensibility) (x :: Extensibility).
 CmmNode e x -&gt; Maybe BlockId -&gt; Maybe BlockId)
-&gt; forall (e :: Extensibility) (x :: Extensibility).
   Block CmmNode e x
   -&gt; IndexedCO x (Maybe BlockId) (Maybe BlockId)
   -&gt; IndexedCO e (Maybe BlockId) (Maybe BlockId)
forall (n :: Extensibility -&gt; Extensibility -&gt; *) a.
(forall (e :: Extensibility) (x :: Extensibility). n e x -&gt; a -&gt; a)
-&gt; forall (e :: Extensibility) (x :: Extensibility).
   Block n e x -&gt; IndexedCO x a a -&gt; IndexedCO e a a
</span><a href="GHC.Cmm.Dataflow.Block.html#foldBlockNodesB"><span class="hs-identifier hs-var">foldBlockNodesB</span></a></span><span> </span><span class="annot"><span class="annottext">forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; Maybe BlockId -&gt; Maybe BlockId
</span><a href="#local-6989586621681066679"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066681"><span class="hs-identifier hs-var">middle</span></a></span><span> </span><span class="annot"><span class="annottext">IndexedCO O (Maybe BlockId) (Maybe BlockId)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-706"></span><span>   </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066677"><span id="local-6989586621681066678"><span class="annot"><a href="#local-6989586621681066679"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681066678"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681066677"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span></span></span><span>
</span><span id="line-707"></span><span>         </span><span id="local-6989586621681066679"><span class="annot"><span class="annottext">f :: forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; Maybe BlockId -&gt; Maybe BlockId
</span><a href="#local-6989586621681066679"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmStore"><span class="hs-identifier hs-type">CmmStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-type">CmmStackSlot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-type">Young</span></a></span><span> </span><span id="local-6989586621681066674"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066674"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-708"></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Maybe BlockId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066674"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-709"></span><span>         </span><span class="annot"><a href="#local-6989586621681066679"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode a b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066671"><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681066671"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681066671"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-712"></span><span class="hs-comment">-- Saving live registers</span><span>
</span><span id="line-713"></span><span>
</span><span id="line-714"></span><span class="hs-comment">-- | Given a set of live registers and a StackMap, save all the registers</span><span>
</span><span id="line-715"></span><span class="hs-comment">-- on the stack and return the new StackMap and the assignments to do</span><span>
</span><span id="line-716"></span><span class="hs-comment">-- the saving.</span><span>
</span><span id="line-717"></span><span class="hs-comment">--</span><span>
</span><span id="line-718"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#allocate"><span class="hs-identifier hs-type">allocate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalRegSet"><span class="hs-identifier hs-type">LocalRegSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>
</span><span id="line-719"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-720"></span><span id="allocate"><span class="annot"><span class="annottext">allocate :: Platform
-&gt; ByteOff -&gt; CmmLocalLive -&gt; StackMap -&gt; (StackMap, [CmmNode O O])
</span><a href="GHC.Cmm.LayoutStack.html#allocate"><span class="hs-identifier hs-var hs-var">allocate</span></a></span></span><span> </span><span id="local-6989586621681066669"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066668"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066668"><span class="hs-identifier hs-var">ret_off</span></a></span></span><span> </span><span id="local-6989586621681066667"><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066667"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681066666"><span class="annot"><span class="annottext">stackmap :: StackMap
</span><a href="#local-6989586621681066666"><span class="hs-identifier hs-var">stackmap</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_sp :: StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681066665"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066665"><span class="hs-identifier hs-var">sp0</span></a></span></span><span>
</span><span id="line-721"></span><span>                                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_regs :: StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681066664"><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066664"><span class="hs-identifier hs-var">regs0</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-722"></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-723"></span><span>   </span><span class="hs-comment">-- we only have to save regs that are not already in a slot</span><span>
</span><span id="line-724"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066663"><span class="annot"><span class="annottext">to_save :: [LocalReg]
</span><a href="#local-6989586621681066663"><span class="hs-identifier hs-var hs-var">to_save</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LocalReg -&gt; Bool) -&gt; [LocalReg] -&gt; [LocalReg]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (LocalReg -&gt; Bool) -&gt; LocalReg -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; UniqFM LocalReg (LocalReg, ByteOff) -&gt; Bool
forall key elt. Uniquable key =&gt; key -&gt; UniqFM key elt -&gt; Bool
</span><a href="GHC.Types.Unique.FM.html#elemUFM"><span class="hs-operator hs-var">`elemUFM`</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066664"><span class="hs-identifier hs-var">regs0</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLocalLive -&gt; [LocalReg]
forall a. Set a -&gt; [a]
</span><a href="../../containers/src/Data.Set.Internal.html#elems"><span class="hs-identifier hs-var">Set.elems</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066667"><span class="hs-identifier hs-var">live</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-725"></span><span>       </span><span id="local-6989586621681066658"><span class="annot"><span class="annottext">regs1 :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066658"><span class="hs-identifier hs-var hs-var">regs1</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((LocalReg, ByteOff) -&gt; Bool)
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
forall elt key. (elt -&gt; Bool) -&gt; UniqFM key elt -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#filterUFM"><span class="hs-identifier hs-var">filterUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681066657"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066657"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; CmmLocalLive -&gt; Bool
forall r. Ord r =&gt; r -&gt; RegSet r -&gt; Bool
</span><a href="GHC.Cmm.Expr.html#elemRegSet"><span class="hs-identifier hs-var">elemRegSet</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066657"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066667"><span class="hs-identifier hs-var">live</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066664"><span class="hs-identifier hs-var">regs0</span></a></span><span>
</span><span id="line-726"></span><span>   </span><span class="hs-keyword">in</span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span>   </span><span class="hs-comment">-- make a map of the stack</span><span>
</span><span id="line-729"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066656"><span class="annot"><span class="annottext">stack :: [StackSlot]
</span><a href="#local-6989586621681066656"><span class="hs-identifier hs-var hs-var">stack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[StackSlot] -&gt; [StackSlot]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([StackSlot] -&gt; [StackSlot]) -&gt; [StackSlot] -&gt; [StackSlot]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Array ByteOff StackSlot -&gt; [StackSlot]
forall i e. Array i e -&gt; [e]
</span><a href="../../base/src/GHC.Arr.html#elems"><span class="hs-identifier hs-var">Array.elems</span></a></span><span> </span><span class="annot"><span class="annottext">(Array ByteOff StackSlot -&gt; [StackSlot])
-&gt; Array ByteOff StackSlot -&gt; [StackSlot]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-730"></span><span>               </span><span class="annot"><span class="annottext">(StackSlot -&gt; StackSlot -&gt; StackSlot)
-&gt; StackSlot
-&gt; (ByteOff, ByteOff)
-&gt; [(ByteOff, StackSlot)]
-&gt; Array ByteOff StackSlot
forall i e a.
Ix i =&gt;
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; [(i, a)] -&gt; Array i e
</span><a href="../../base/src/GHC.Arr.html#accumArray"><span class="hs-identifier hs-var">accumArray</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">StackSlot
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066652"><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066652"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066652"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066665"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066668"><span class="hs-identifier hs-var">ret_off</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([(ByteOff, StackSlot)] -&gt; Array ByteOff StackSlot)
-&gt; [(ByteOff, StackSlot)] -&gt; Array ByteOff StackSlot
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-731"></span><span>                 </span><span class="annot"><span class="annottext">[(ByteOff, StackSlot)]
</span><a href="#local-6989586621681066648"><span class="hs-identifier hs-var">ret_words</span></a></span><span> </span><span class="annot"><span class="annottext">[(ByteOff, StackSlot)]
-&gt; [(ByteOff, StackSlot)] -&gt; [(ByteOff, StackSlot)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(ByteOff, StackSlot)]
</span><a href="#local-6989586621681066647"><span class="hs-identifier hs-var">live_words</span></a></span><span>
</span><span id="line-732"></span><span>            </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066648"><span class="annot"><span class="annottext">ret_words :: [(ByteOff, StackSlot)]
</span><a href="#local-6989586621681066648"><span class="hs-identifier hs-var hs-var">ret_words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-733"></span><span>                   </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066646"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-734"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681066646"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066646"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066668"><span class="hs-identifier hs-var">ret_off</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-735"></span><span>                  </span><span id="local-6989586621681066647"><span class="annot"><span class="annottext">live_words :: [(ByteOff, StackSlot)]
</span><a href="#local-6989586621681066647"><span class="hs-identifier hs-var hs-var">live_words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-736"></span><span>                   </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066644"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-737"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066643"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066643"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681066642"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066642"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff) -&gt; [(LocalReg, ByteOff)]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066658"><span class="hs-identifier hs-var">regs1</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-738"></span><span>                   </span><span class="hs-comment">-- See Note [Unique Determinism and code generation]</span><span>
</span><span id="line-739"></span><span>                     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066640"><span class="annot"><span class="annottext">w :: ByteOff
</span><a href="#local-6989586621681066640"><span class="hs-identifier hs-var hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; LocalReg -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#localRegBytes"><span class="hs-identifier hs-var">localRegBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066643"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-740"></span><span>                     </span><span id="local-6989586621681066644"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066644"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066642"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066642"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066642"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066640"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-741"></span><span>   </span><span class="hs-keyword">in</span><span>
</span><span id="line-742"></span><span>
</span><span id="line-743"></span><span>   </span><span class="hs-comment">-- Pass over the stack: find slots to save all the new live variables,</span><span>
</span><span id="line-744"></span><span>   </span><span class="hs-comment">-- choosing the oldest slots first (hence a foldr).</span><span>
</span><span id="line-745"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-746"></span><span>       </span><span id="local-6989586621681066638"><span class="annot"><span class="annottext">save :: StackSlot
-&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
    [(LocalReg, (LocalReg, ByteOff))])
-&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
    [(LocalReg, (LocalReg, ByteOff))])
</span><a href="#local-6989586621681066638"><span class="hs-identifier hs-var hs-var">save</span></a></span></span><span> </span><span id="local-6989586621681066637"><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066637"><span class="hs-identifier hs-var">slot</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066636"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066636"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066635"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066635"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066634"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066634"><span class="hs-identifier hs-var">assigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066633"><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066633"><span class="hs-identifier hs-var">regs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- no more regs to save</span><span>
</span><span id="line-747"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066637"><span class="hs-identifier hs-var">slot</span></a></span><span class="annot"><span class="annottext">StackSlot -&gt; [StackSlot] -&gt; [StackSlot]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066636"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-var">plusW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066635"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066634"><span class="hs-identifier hs-var">assigs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066633"><span class="hs-identifier hs-var">regs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-748"></span><span>       </span><span class="annot"><a href="#local-6989586621681066638"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span id="local-6989586621681066631"><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066631"><span class="hs-identifier hs-var">slot</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066630"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066630"><span class="hs-identifier hs-var">to_save</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066629"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066629"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066628"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066628"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066627"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066627"><span class="hs-identifier hs-var">assigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066626"><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066626"><span class="hs-identifier hs-var">regs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-749"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066631"><span class="hs-identifier hs-var">slot</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-750"></span><span>               </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066630"><span class="hs-identifier hs-var">to_save</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span><span class="annot"><span class="annottext">StackSlot -&gt; [StackSlot] -&gt; [StackSlot]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066629"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-var">plusW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066628"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066627"><span class="hs-identifier hs-var">assigs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066626"><span class="hs-identifier hs-var">regs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-751"></span><span>               </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-752"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066625"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066625"><span class="hs-identifier hs-var">stack'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066624"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066624"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066623"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066623"><span class="hs-identifier hs-var">to_save'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-753"></span><span>                       </span><span class="annot"><span class="annottext">[LocalReg]
-&gt; [StackSlot] -&gt; Maybe ([StackSlot], LocalReg, [LocalReg])
</span><a href="#local-6989586621681066622"><span class="hs-identifier hs-var">select_save</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066630"><span class="hs-identifier hs-var">to_save</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066631"><span class="hs-identifier hs-var">slot</span></a></span><span class="annot"><span class="annottext">StackSlot -&gt; [StackSlot] -&gt; [StackSlot]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066629"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-754"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066621"><span class="annot"><span class="annottext">assig :: CmmNode O O
</span><a href="#local-6989586621681066621"><span class="hs-identifier hs-var hs-var">assig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmStore"><span class="hs-identifier hs-var">CmmStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Area -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-var">CmmStackSlot</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="GHC.Cmm.Expr.html#Old"><span class="hs-identifier hs-var">Old</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066620"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-755"></span><span>                                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066624"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-756"></span><span>                        </span><span id="local-6989586621681066620"><span class="annot"><span class="annottext">n' :: ByteOff
</span><a href="#local-6989586621681066620"><span class="hs-identifier hs-var hs-var">n'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-var">plusW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066628"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span>
</span><span id="line-757"></span><span>                   </span><span class="hs-keyword">in</span><span>
</span><span id="line-758"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066623"><span class="hs-identifier hs-var">to_save'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066625"><span class="hs-identifier hs-var">stack'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066620"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066621"><span class="hs-identifier hs-var">assig</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; [CmmNode O O] -&gt; [CmmNode O O]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066627"><span class="hs-identifier hs-var">assigs</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066624"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066624"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066620"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="annot"><span class="annottext">(LocalReg, (LocalReg, ByteOff))
-&gt; [(LocalReg, (LocalReg, ByteOff))]
-&gt; [(LocalReg, (LocalReg, ByteOff))]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066626"><span class="hs-identifier hs-var">regs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-759"></span><span>
</span><span id="line-760"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-761"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066630"><span class="hs-identifier hs-var">to_save</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="#local-6989586621681066631"><span class="hs-identifier hs-var">slot</span></a></span><span class="annot"><span class="annottext">StackSlot -&gt; [StackSlot] -&gt; [StackSlot]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066629"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-var">plusW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066628"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066627"><span class="hs-identifier hs-var">assigs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066626"><span class="hs-identifier hs-var">regs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-762"></span><span>
</span><span id="line-763"></span><span>       </span><span class="hs-comment">-- we should do better here: right now we'll fit the smallest first,</span><span>
</span><span id="line-764"></span><span>       </span><span class="hs-comment">-- but it would make more sense to fit the biggest first.</span><span>
</span><span id="line-765"></span><span>       </span><span class="annot"><a href="#local-6989586621681066622"><span class="hs-identifier hs-type">select_save</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-type">StackSlot</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-766"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-type">StackSlot</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-767"></span><span>       </span><span id="local-6989586621681066622"><span class="annot"><span class="annottext">select_save :: [LocalReg]
-&gt; [StackSlot] -&gt; Maybe ([StackSlot], LocalReg, [LocalReg])
</span><a href="#local-6989586621681066622"><span class="hs-identifier hs-var hs-var">select_save</span></a></span></span><span> </span><span id="local-6989586621681066619"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066619"><span class="hs-identifier hs-var">regs</span></a></span></span><span> </span><span id="local-6989586621681066618"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066618"><span class="hs-identifier hs-var">stack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
-&gt; [LocalReg] -&gt; Maybe ([StackSlot], LocalReg, [LocalReg])
</span><a href="#local-6989586621681066617"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066619"><span class="hs-identifier hs-var">regs</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-768"></span><span>         </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066617"><span class="annot"><span class="annottext">go :: [LocalReg]
-&gt; [LocalReg] -&gt; Maybe ([StackSlot], LocalReg, [LocalReg])
</span><a href="#local-6989586621681066617"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span id="local-6989586621681066616"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066616"><span class="hs-identifier hs-var">_no_fit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([StackSlot], LocalReg, [LocalReg])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-769"></span><span>               </span><span class="annot"><a href="#local-6989586621681066617"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066615"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066615"><span class="hs-identifier hs-var">r</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681066614"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066614"><span class="hs-identifier hs-var">rs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066613"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066613"><span class="hs-identifier hs-var">no_fit</span></a></span></span><span>
</span><span id="line-770"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066612"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066612"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; [StackSlot] -&gt; Maybe [StackSlot]
</span><a href="GHC.Cmm.LayoutStack.html#dropEmpty"><span class="hs-identifier hs-var">dropEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066610"><span class="hs-identifier hs-var">words</span></a></span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066618"><span class="hs-identifier hs-var">stack</span></a></span><span>
</span><span id="line-771"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([StackSlot], LocalReg, [LocalReg])
-&gt; Maybe ([StackSlot], LocalReg, [LocalReg])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff -&gt; StackSlot -&gt; [StackSlot]
forall a. ByteOff -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066610"><span class="hs-identifier hs-var">words</span></a></span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span><span> </span><span class="annot"><span class="annottext">[StackSlot] -&gt; [StackSlot] -&gt; [StackSlot]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066612"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066615"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066614"><span class="hs-identifier hs-var">rs</span></a></span><span class="annot"><span class="annottext">[LocalReg] -&gt; [LocalReg] -&gt; [LocalReg]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066613"><span class="hs-identifier hs-var">no_fit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-772"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-773"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
-&gt; [LocalReg] -&gt; Maybe ([StackSlot], LocalReg, [LocalReg])
</span><a href="#local-6989586621681066617"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066614"><span class="hs-identifier hs-var">rs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066615"><span class="hs-identifier hs-var">r</span></a></span><span class="annot"><span class="annottext">LocalReg -&gt; [LocalReg] -&gt; [LocalReg]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066613"><span class="hs-identifier hs-var">no_fit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-774"></span><span>                 </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066610"><span class="annot"><span class="annottext">words :: ByteOff
</span><a href="#local-6989586621681066610"><span class="hs-identifier hs-var hs-var">words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; LocalReg -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#localRegWords"><span class="hs-identifier hs-var">localRegWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066615"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>       </span><span class="hs-comment">-- fill in empty slots as much as possible</span><span>
</span><span id="line-777"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681066607"><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066607"><span class="hs-identifier hs-var">still_to_save</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066606"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066606"><span class="hs-identifier hs-var">save_stack</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066605"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066605"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066604"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066604"><span class="hs-identifier hs-var">save_assigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066603"><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066603"><span class="hs-identifier hs-var">save_regs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-778"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(StackSlot
 -&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
     [(LocalReg, (LocalReg, ByteOff))])
 -&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
     [(LocalReg, (LocalReg, ByteOff))]))
-&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
    [(LocalReg, (LocalReg, ByteOff))])
-&gt; [StackSlot]
-&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
    [(LocalReg, (LocalReg, ByteOff))])
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">StackSlot
-&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
    [(LocalReg, (LocalReg, ByteOff))])
-&gt; ([LocalReg], [StackSlot], ByteOff, [CmmNode O O],
    [(LocalReg, (LocalReg, ByteOff))])
</span><a href="#local-6989586621681066638"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066663"><span class="hs-identifier hs-var">to_save</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066656"><span class="hs-identifier hs-var">stack</span></a></span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span>       </span><span class="hs-comment">-- push any remaining live vars on the stack</span><span>
</span><span id="line-781"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681066601"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066601"><span class="hs-identifier hs-var">push_sp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066600"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066600"><span class="hs-identifier hs-var">push_assigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066599"><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066599"><span class="hs-identifier hs-var">push_regs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-782"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LocalReg
 -&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
 -&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))]))
-&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
-&gt; [LocalReg]
-&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
-&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
-&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
</span><a href="#local-6989586621681066598"><span class="hs-identifier hs-var">push</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066605"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066607"><span class="hs-identifier hs-var">still_to_save</span></a></span><span>
</span><span id="line-783"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-784"></span><span>              </span><span id="local-6989586621681066598"><span class="annot"><span class="annottext">push :: LocalReg
-&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
-&gt; (ByteOff, [CmmNode O O], [(LocalReg, (LocalReg, ByteOff))])
</span><a href="#local-6989586621681066598"><span class="hs-identifier hs-var hs-var">push</span></a></span></span><span> </span><span id="local-6989586621681066597"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066597"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066596"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066596"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066595"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066595"><span class="hs-identifier hs-var">assigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066594"><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066594"><span class="hs-identifier hs-var">regs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-785"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066593"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066592"><span class="hs-identifier hs-var">assig</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; [CmmNode O O] -&gt; [CmmNode O O]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066595"><span class="hs-identifier hs-var">assigs</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066597"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066597"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066593"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(LocalReg, (LocalReg, ByteOff))
-&gt; [(LocalReg, (LocalReg, ByteOff))]
-&gt; [(LocalReg, (LocalReg, ByteOff))]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066594"><span class="hs-identifier hs-var">regs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-786"></span><span>                </span><span class="hs-keyword">where</span><span>
</span><span id="line-787"></span><span>                  </span><span id="local-6989586621681066593"><span class="annot"><span class="annottext">n' :: ByteOff
</span><a href="#local-6989586621681066593"><span class="hs-identifier hs-var hs-var">n'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066596"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; LocalReg -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#localRegBytes"><span class="hs-identifier hs-var">localRegBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066597"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-788"></span><span>                  </span><span id="local-6989586621681066592"><span class="annot"><span class="annottext">assig :: CmmNode O O
</span><a href="#local-6989586621681066592"><span class="hs-identifier hs-var hs-var">assig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmStore"><span class="hs-identifier hs-var">CmmStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Area -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-var">CmmStackSlot</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="GHC.Cmm.Expr.html#Old"><span class="hs-identifier hs-var">Old</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066593"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-789"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066597"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-790"></span><span>
</span><span id="line-791"></span><span>       </span><span id="local-6989586621681066591"><span class="annot"><span class="annottext">trim_sp :: ByteOff
</span><a href="#local-6989586621681066591"><span class="hs-identifier hs-var hs-var">trim_sp</span></a></span></span><span>
</span><span id="line-792"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066599"><span class="hs-identifier hs-var">push_regs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066601"><span class="hs-identifier hs-var">push_sp</span></a></span><span>
</span><span id="line-793"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-794"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-var">plusW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066605"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span> </span><span class="annot"><span class="annottext">[StackSlot] -&gt; ByteOff
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; ByteOff
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(StackSlot -&gt; Bool) -&gt; [StackSlot] -&gt; [StackSlot]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#takeWhile"><span class="hs-identifier hs-var">takeWhile</span></a></span><span> </span><span class="annot"><span class="annottext">StackSlot -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#isEmpty"><span class="hs-identifier hs-var">isEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066606"><span class="hs-identifier hs-var">save_stack</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-795"></span><span>
</span><span id="line-796"></span><span>       </span><span id="local-6989586621681066587"><span class="annot"><span class="annottext">final_regs :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066587"><span class="hs-identifier hs-var hs-var">final_regs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066658"><span class="hs-identifier hs-var">regs1</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; [(LocalReg, (LocalReg, ByteOff))]
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; [(key, elt)] -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addListToUFM"><span class="hs-operator hs-var">`addListToUFM`</span></a></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066599"><span class="hs-identifier hs-var">push_regs</span></a></span><span>
</span><span id="line-797"></span><span>                          </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; [(LocalReg, (LocalReg, ByteOff))]
-&gt; UniqFM LocalReg (LocalReg, ByteOff)
forall key elt.
Uniquable key =&gt;
UniqFM key elt -&gt; [(key, elt)] -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#addListToUFM"><span class="hs-operator hs-var">`addListToUFM`</span></a></span><span> </span><span class="annot"><span class="annottext">[(LocalReg, (LocalReg, ByteOff))]
</span><a href="#local-6989586621681066603"><span class="hs-identifier hs-var">save_regs</span></a></span><span>
</span><span id="line-798"></span><span>
</span><span id="line-799"></span><span>   </span><span class="hs-keyword">in</span><span>
</span><span id="line-800"></span><span>  </span><span class="hs-comment">-- XXX should be an assert</span><span>
</span><span id="line-801"></span><span>   </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066605"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066665"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066668"><span class="hs-identifier hs-var">ret_off</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (StackMap, [CmmNode O O])
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;allocate&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066605"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066665"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066668"><span class="hs-identifier hs-var">ret_off</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-802"></span><span>
</span><span id="line-803"></span><span>   </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066591"><span class="hs-identifier hs-var">trim_sp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066669"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (StackMap, [CmmNode O O])
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;allocate2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066591"><span class="hs-identifier hs-var">trim_sp</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066587"><span class="hs-identifier hs-var">final_regs</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066601"><span class="hs-identifier hs-var">push_sp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-804"></span><span>
</span><span id="line-805"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066666"><span class="hs-identifier hs-var">stackmap</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var">sm_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066587"><span class="hs-identifier hs-var">final_regs</span></a></span><span> </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_sp :: ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066591"><span class="hs-identifier hs-var">trim_sp</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-806"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066600"><span class="hs-identifier hs-var">push_assigs</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O] -&gt; [CmmNode O O] -&gt; [CmmNode O O]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066604"><span class="hs-identifier hs-var">save_assigs</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-807"></span><span>
</span><span id="line-808"></span><span>
</span><span id="line-809"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-810"></span><span class="hs-comment">-- Manifesting Sp</span><span>
</span><span id="line-811"></span><span>
</span><span id="line-812"></span><span class="hs-comment">-- | Manifest Sp: turn all the CmmStackSlots into CmmLoads from Sp.  The</span><span>
</span><span id="line-813"></span><span class="hs-comment">-- block looks like this:</span><span>
</span><span id="line-814"></span><span class="hs-comment">--</span><span>
</span><span id="line-815"></span><span class="hs-comment">--    middle_pre       -- the middle nodes</span><span>
</span><span id="line-816"></span><span class="hs-comment">--    Sp = Sp + sp_off -- Sp adjustment goes here</span><span>
</span><span id="line-817"></span><span class="hs-comment">--    last             -- the last node</span><span>
</span><span id="line-818"></span><span class="hs-comment">--</span><span>
</span><span id="line-819"></span><span class="hs-comment">-- And we have some extra blocks too (that don't contain Sp adjustments)</span><span>
</span><span id="line-820"></span><span class="hs-comment">--</span><span>
</span><span id="line-821"></span><span class="hs-comment">-- The adjustment for middle_pre will be different from that for</span><span>
</span><span id="line-822"></span><span class="hs-comment">-- middle_post, because the Sp adjustment intervenes.</span><span>
</span><span id="line-823"></span><span class="hs-comment">--</span><span>
</span><span id="line-824"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#manifestSp"><span class="hs-identifier hs-type">manifestSp</span></a></span><span>
</span><span id="line-825"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-826"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>  </span><span class="hs-comment">-- StackMaps for other blocks</span><span>
</span><span id="line-827"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>           </span><span class="hs-comment">-- StackMap for this block</span><span>
</span><span id="line-828"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>            </span><span class="hs-comment">-- Sp on entry to the block</span><span>
</span><span id="line-829"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>            </span><span class="hs-comment">-- SpHigh</span><span>
</span><span id="line-830"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span>        </span><span class="hs-comment">-- first node</span><span>
</span><span id="line-831"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- middle</span><span>
</span><span id="line-832"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>            </span><span class="hs-comment">-- sp_off</span><span>
</span><span id="line-833"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>        </span><span class="hs-comment">-- last node</span><span>
</span><span id="line-834"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- new blocks</span><span>
</span><span id="line-835"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- final blocks with Sp manifest</span><span>
</span><span id="line-836"></span><span>
</span><span id="line-837"></span><span id="manifestSp"><span class="annot"><span class="annottext">manifestSp :: DynFlags
-&gt; LabelMap StackMap
-&gt; StackMap
-&gt; ByteOff
-&gt; ByteOff
-&gt; CmmNode C O
-&gt; [CmmNode O O]
-&gt; ByteOff
-&gt; CmmNode O C
-&gt; [CmmBlock]
-&gt; [CmmBlock]
</span><a href="GHC.Cmm.LayoutStack.html#manifestSp"><span class="hs-identifier hs-var hs-var">manifestSp</span></a></span></span><span> </span><span id="local-6989586621681066582"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066582"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066581"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066581"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066580"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066580"><span class="hs-identifier hs-var">stack0</span></a></span></span><span> </span><span id="local-6989586621681066579"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066579"><span class="hs-identifier hs-var">sp0</span></a></span></span><span> </span><span id="local-6989586621681066578"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066578"><span class="hs-identifier hs-var">sp_high</span></a></span></span><span>
</span><span id="line-838"></span><span>           </span><span id="local-6989586621681066577"><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066577"><span class="hs-identifier hs-var">first</span></a></span></span><span> </span><span id="local-6989586621681066576"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066576"><span class="hs-identifier hs-var">middle_pre</span></a></span></span><span> </span><span id="local-6989586621681066575"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066575"><span class="hs-identifier hs-var">sp_off</span></a></span></span><span> </span><span id="local-6989586621681066574"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066574"><span class="hs-identifier hs-var">last</span></a></span></span><span> </span><span id="local-6989586621681066573"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066573"><span class="hs-identifier hs-var">fixup_blocks</span></a></span></span><span>
</span><span id="line-839"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066572"><span class="hs-identifier hs-var">final_block</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; [CmmBlock] -&gt; [CmmBlock]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066571"><span class="hs-identifier hs-var">fixup_blocks'</span></a></span><span>
</span><span id="line-840"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-841"></span><span>    </span><span id="local-6989586621681066570"><span class="annot"><span class="annottext">area_off :: Area -&gt; ByteOff
</span><a href="#local-6989586621681066570"><span class="hs-identifier hs-var hs-var">area_off</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap -&gt; Area -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#getAreaOff"><span class="hs-identifier hs-var">getAreaOff</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066581"><span class="hs-identifier hs-var">stackmaps</span></a></span><span>
</span><span id="line-842"></span><span>    </span><span id="local-6989586621681066568"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681066568"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066582"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-843"></span><span>
</span><span id="line-844"></span><span>    </span><span id="local-6989586621681067303"><span id="local-6989586621681067304"><span class="annot"><a href="#local-6989586621681066567"><span class="hs-identifier hs-type">adj_pre_sp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681066566"><span class="hs-identifier hs-type">adj_post_sp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067304"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067303"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067304"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681067303"><span class="hs-identifier hs-type">x</span></a></span></span></span><span>
</span><span id="line-845"></span><span>    </span><span id="local-6989586621681066567"><span class="annot"><span class="annottext">adj_pre_sp :: forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681066567"><span class="hs-identifier hs-var hs-var">adj_pre_sp</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
forall (e :: Extensibility) (x :: Extensibility).
(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
</span><a href="GHC.Cmm.Node.html#mapExpDeep"><span class="hs-identifier hs-var">mapExpDeep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform
-&gt; ByteOff -&gt; ByteOff -&gt; (Area -&gt; ByteOff) -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var">areaToSp</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066568"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066579"><span class="hs-identifier hs-var">sp0</span></a></span><span>            </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066578"><span class="hs-identifier hs-var">sp_high</span></a></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066570"><span class="hs-identifier hs-var">area_off</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-846"></span><span>    </span><span id="local-6989586621681066566"><span class="annot"><span class="annottext">adj_post_sp :: forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681066566"><span class="hs-identifier hs-var hs-var">adj_post_sp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
forall (e :: Extensibility) (x :: Extensibility).
(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
</span><a href="GHC.Cmm.Node.html#mapExpDeep"><span class="hs-identifier hs-var">mapExpDeep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform
-&gt; ByteOff -&gt; ByteOff -&gt; (Area -&gt; ByteOff) -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var">areaToSp</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066568"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066579"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066575"><span class="hs-identifier hs-var">sp_off</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066578"><span class="hs-identifier hs-var">sp_high</span></a></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066570"><span class="hs-identifier hs-var">area_off</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-847"></span><span>
</span><span id="line-848"></span><span>    </span><span id="local-6989586621681066562"><span class="annot"><span class="annottext">final_middle :: Block CmmNode O O
</span><a href="#local-6989586621681066562"><span class="hs-identifier hs-var hs-var">final_middle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; ByteOff -&gt; ByteOff -&gt; Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#maybeAddSpAdj"><span class="hs-identifier hs-var">maybeAddSpAdj</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066582"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066579"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066575"><span class="hs-identifier hs-var">sp_off</span></a></span><span>
</span><span id="line-849"></span><span>                 </span><span class="annot"><span class="annottext">(Block CmmNode O O -&gt; Block CmmNode O O)
-&gt; ([CmmNode O O] -&gt; Block CmmNode O O)
-&gt; [CmmNode O O]
-&gt; Block CmmNode O O
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O] -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
[n O O] -&gt; Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#blockFromList"><span class="hs-identifier hs-var">blockFromList</span></a></span><span>
</span><span id="line-850"></span><span>                 </span><span class="annot"><span class="annottext">([CmmNode O O] -&gt; Block CmmNode O O)
-&gt; ([CmmNode O O] -&gt; [CmmNode O O])
-&gt; [CmmNode O O]
-&gt; Block CmmNode O O
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmNode O O -&gt; CmmNode O O) -&gt; [CmmNode O O] -&gt; [CmmNode O O]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; CmmNode O O
forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681066567"><span class="hs-identifier hs-var">adj_pre_sp</span></a></span><span>
</span><span id="line-851"></span><span>                 </span><span class="annot"><span class="annottext">([CmmNode O O] -&gt; [CmmNode O O])
-&gt; ([CmmNode O O] -&gt; [CmmNode O O])
-&gt; [CmmNode O O]
-&gt; [CmmNode O O]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
-&gt; LabelMap StackMap
-&gt; (Area -&gt; ByteOff)
-&gt; [CmmNode O O]
-&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#elimStackStores"><span class="hs-identifier hs-var">elimStackStores</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066580"><span class="hs-identifier hs-var">stack0</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066581"><span class="hs-identifier hs-var">stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066570"><span class="hs-identifier hs-var">area_off</span></a></span><span>
</span><span id="line-852"></span><span>                 </span><span class="annot"><span class="annottext">([CmmNode O O] -&gt; Block CmmNode O O)
-&gt; [CmmNode O O] -&gt; Block CmmNode O O
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066576"><span class="hs-identifier hs-var">middle_pre</span></a></span><span>
</span><span id="line-853"></span><span>    </span><span id="local-6989586621681066560"><span class="annot"><span class="annottext">final_last :: CmmNode O C
</span><a href="#local-6989586621681066560"><span class="hs-identifier hs-var hs-var">final_last</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; CmmNode O C
</span><a href="GHC.Cmm.LayoutStack.html#optStackCheck"><span class="hs-identifier hs-var">optStackCheck</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O C -&gt; CmmNode O C
forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681066566"><span class="hs-identifier hs-var">adj_post_sp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066574"><span class="hs-identifier hs-var">last</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-854"></span><span>
</span><span id="line-855"></span><span>    </span><span id="local-6989586621681066572"><span class="annot"><span class="annottext">final_block :: CmmBlock
</span><a href="#local-6989586621681066572"><span class="hs-identifier hs-var hs-var">final_block</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode C O -&gt; Block CmmNode O O -&gt; CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
n C O -&gt; Block n O O -&gt; n O C -&gt; Block n C C
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoin"><span class="hs-identifier hs-var">blockJoin</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066577"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066562"><span class="hs-identifier hs-var">final_middle</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066560"><span class="hs-identifier hs-var">final_last</span></a></span><span>
</span><span id="line-856"></span><span>
</span><span id="line-857"></span><span>    </span><span id="local-6989586621681066571"><span class="annot"><span class="annottext">fixup_blocks' :: [CmmBlock]
</span><a href="#local-6989586621681066571"><span class="hs-identifier hs-var hs-var">fixup_blocks'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmBlock -&gt; CmmBlock) -&gt; [CmmBlock] -&gt; [CmmBlock]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CmmNode C O -&gt; CmmNode C O, CmmNode O O -&gt; CmmNode O O,
 CmmNode O C -&gt; CmmNode O C)
-&gt; CmmBlock -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (n' :: Extensibility -&gt; Extensibility -&gt; *) (e :: Extensibility)
       (x :: Extensibility).
(n C O -&gt; n' C O, n O O -&gt; n' O O, n O C -&gt; n' O C)
-&gt; Block n e x -&gt; Block n' e x
</span><a href="GHC.Cmm.Dataflow.Block.html#mapBlock3%27"><span class="hs-identifier hs-var">mapBlock3'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O -&gt; CmmNode C O
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; CmmNode O O
forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681066566"><span class="hs-identifier hs-var">adj_post_sp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; CmmNode O C
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066573"><span class="hs-identifier hs-var">fixup_blocks</span></a></span><span>
</span><span id="line-858"></span><span>
</span><span id="line-859"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#getAreaOff"><span class="hs-identifier hs-type">getAreaOff</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Area"><span class="hs-identifier hs-type">Area</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-type">StackLoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-860"></span><span id="getAreaOff"><span class="annot"><span class="annottext">getAreaOff :: LabelMap StackMap -&gt; Area -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#getAreaOff"><span class="hs-identifier hs-var hs-var">getAreaOff</span></a></span></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="GHC.Cmm.Expr.html#Old"><span class="hs-identifier hs-var">Old</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-861"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#getAreaOff"><span class="hs-identifier hs-var">getAreaOff</span></a></span><span> </span><span id="local-6989586621681066556"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066556"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-type">Young</span></a></span><span> </span><span id="local-6989586621681066555"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066555"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-862"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap StackMap -&gt; Maybe StackMap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066555"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066556"><span class="hs-identifier hs-var">stackmaps</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-863"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066554"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066554"><span class="hs-identifier hs-var">sm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066554"><span class="hs-identifier hs-var">sm</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_args"><span class="hs-identifier hs-var hs-var">sm_args</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066554"><span class="hs-identifier hs-var">sm</span></a></span><span>
</span><span id="line-864"></span><span>    </span><span class="annot"><span class="annottext">Maybe StackMap
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ByteOff
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;getAreaOff&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066555"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-865"></span><span>
</span><span id="line-866"></span><span>
</span><span id="line-867"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#maybeAddSpAdj"><span class="hs-identifier hs-type">maybeAddSpAdj</span></a></span><span>
</span><span id="line-868"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span>
</span><span id="line-869"></span><span id="maybeAddSpAdj"><span class="annot"><span class="annottext">maybeAddSpAdj :: DynFlags
-&gt; ByteOff -&gt; ByteOff -&gt; Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#maybeAddSpAdj"><span class="hs-identifier hs-var hs-var">maybeAddSpAdj</span></a></span></span><span> </span><span id="local-6989586621681066553"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066553"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066552"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066552"><span class="hs-identifier hs-var">sp0</span></a></span></span><span> </span><span id="local-6989586621681066551"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066551"><span class="hs-identifier hs-var">sp_off</span></a></span></span><span> </span><span id="local-6989586621681066550"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066550"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-870"></span><span>  </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="#local-6989586621681066549"><span class="hs-identifier hs-var">add_initial_unwind</span></a></span><span> </span><span class="annot"><span class="annottext">(Block CmmNode O O -&gt; Block CmmNode O O)
-&gt; Block CmmNode O O -&gt; Block CmmNode O O
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="#local-6989586621681066548"><span class="hs-identifier hs-var">add_adj_unwind</span></a></span><span> </span><span class="annot"><span class="annottext">(Block CmmNode O O -&gt; Block CmmNode O O)
-&gt; Block CmmNode O O -&gt; Block CmmNode O O
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="#local-6989586621681066547"><span class="hs-identifier hs-var">adj</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066550"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-871"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-872"></span><span>    </span><span id="local-6989586621681066546"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681066546"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066553"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-873"></span><span>    </span><span id="local-6989586621681066547"><span class="annot"><span class="annottext">adj :: Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="#local-6989586621681066547"><span class="hs-identifier hs-var hs-var">adj</span></a></span></span><span> </span><span id="local-6989586621681066545"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066545"><span class="hs-identifier hs-var">block</span></a></span></span><span>
</span><span id="line-874"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066551"><span class="hs-identifier hs-var">sp_off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-875"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066545"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; CmmNode O O -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e O -&gt; n O O -&gt; Block n e O
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSnoc"><span class="hs-operator hs-var">`blockSnoc`</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmAssign"><span class="hs-identifier hs-var">CmmAssign</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="GHC.Cmm.Expr.html#spReg"><span class="hs-identifier hs-var">spReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffset"><span class="hs-identifier hs-var">cmmOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066546"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#spExpr"><span class="hs-identifier hs-var">spExpr</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066551"><span class="hs-identifier hs-var">sp_off</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-876"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066545"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-877"></span><span>    </span><span class="hs-comment">-- Add unwind pseudo-instruction at the beginning of each block to</span><span>
</span><span id="line-878"></span><span>    </span><span class="hs-comment">-- document Sp level for debugging</span><span>
</span><span id="line-879"></span><span>    </span><span id="local-6989586621681066549"><span class="annot"><span class="annottext">add_initial_unwind :: Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="#local-6989586621681066549"><span class="hs-identifier hs-var hs-var">add_initial_unwind</span></a></span></span><span> </span><span id="local-6989586621681066541"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066541"><span class="hs-identifier hs-var">block</span></a></span></span><span>
</span><span id="line-880"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ByteOff
</span><a href="GHC.Driver.Session.html#debugLevel"><span class="hs-identifier hs-var hs-var">debugLevel</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066553"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-881"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(GlobalReg, Maybe CmmExpr)] -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmUnwind"><span class="hs-identifier hs-var">CmmUnwind</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#Sp"><span class="hs-identifier hs-var">Sp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Maybe CmmExpr
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681066536"><span class="hs-identifier hs-var">sp_unwind</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; Block CmmNode O O -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
n O O -&gt; Block n O x -&gt; Block n O x
</span><a href="GHC.Cmm.Dataflow.Block.html#blockCons"><span class="hs-operator hs-var">`blockCons`</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066541"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-882"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-883"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066541"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-884"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066536"><span class="annot"><span class="annottext">sp_unwind :: CmmExpr
</span><a href="#local-6989586621681066536"><span class="hs-identifier hs-var hs-var">sp_unwind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmRegOff"><span class="hs-identifier hs-var">CmmRegOff</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="GHC.Cmm.Expr.html#spReg"><span class="hs-identifier hs-var">spReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066552"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066546"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span>    </span><span class="hs-comment">-- Add unwind pseudo-instruction right after the Sp adjustment</span><span>
</span><span id="line-887"></span><span>    </span><span class="hs-comment">-- if there is one.</span><span>
</span><span id="line-888"></span><span>    </span><span id="local-6989586621681066548"><span class="annot"><span class="annottext">add_adj_unwind :: Block CmmNode O O -&gt; Block CmmNode O O
</span><a href="#local-6989586621681066548"><span class="hs-identifier hs-var hs-var">add_adj_unwind</span></a></span></span><span> </span><span id="local-6989586621681066533"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066533"><span class="hs-identifier hs-var">block</span></a></span></span><span>
</span><span id="line-889"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ByteOff
</span><a href="GHC.Driver.Session.html#debugLevel"><span class="hs-identifier hs-var hs-var">debugLevel</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066553"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-890"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066551"><span class="hs-identifier hs-var">sp_off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span>
</span><span id="line-891"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066533"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; CmmNode O O -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e O -&gt; n O O -&gt; Block n e O
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSnoc"><span class="hs-operator hs-var">`blockSnoc`</span></a></span><span> </span><span class="annot"><span class="annottext">[(GlobalReg, Maybe CmmExpr)] -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmUnwind"><span class="hs-identifier hs-var">CmmUnwind</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#Sp"><span class="hs-identifier hs-var">Sp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Maybe CmmExpr
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681066532"><span class="hs-identifier hs-var">sp_unwind</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-892"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-893"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066533"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-894"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681066532"><span class="annot"><span class="annottext">sp_unwind :: CmmExpr
</span><a href="#local-6989586621681066532"><span class="hs-identifier hs-var hs-var">sp_unwind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmRegOff"><span class="hs-identifier hs-var">CmmRegOff</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="GHC.Cmm.Expr.html#spReg"><span class="hs-identifier hs-var">spReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066552"><span class="hs-identifier hs-var">sp0</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066546"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066551"><span class="hs-identifier hs-var">sp_off</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-895"></span><span>
</span><span id="line-896"></span><span class="hs-comment">{- Note [SP old/young offsets]

Sp(L) is the Sp offset on entry to block L relative to the base of the
OLD area.

SpArgs(L) is the size of the young area for L, i.e. the number of
arguments.

 - in block L, each reference to [old + N] turns into
   [Sp + Sp(L) - N]

 - in block L, each reference to [young(L') + N] turns into
   [Sp + Sp(L) - Sp(L') + SpArgs(L') - N]

 - be careful with the last node of each block: Sp has already been adjusted
   to be Sp + Sp(L) - Sp(L')
-}</span><span>
</span><span id="line-913"></span><span>
</span><span id="line-914"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-type">areaToSp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Area"><span class="hs-identifier hs-type">Area</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-type">StackLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-915"></span><span>
</span><span id="line-916"></span><span id="areaToSp"><span class="annot"><span class="annottext">areaToSp :: Platform
-&gt; ByteOff -&gt; ByteOff -&gt; (Area -&gt; ByteOff) -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var hs-var">areaToSp</span></a></span></span><span> </span><span id="local-6989586621681066531"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066531"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066530"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066530"><span class="hs-identifier hs-var">sp_old</span></a></span></span><span> </span><span id="local-6989586621681066529"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066529"><span class="hs-identifier hs-var">_sp_hwm</span></a></span></span><span> </span><span id="local-6989586621681066528"><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066528"><span class="hs-identifier hs-var">area_off</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-type">CmmStackSlot</span></a></span><span> </span><span id="local-6989586621681066527"><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681066527"><span class="hs-identifier hs-var">area</span></a></span></span><span> </span><span id="local-6989586621681066526"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066526"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-917"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffset"><span class="hs-identifier hs-var">cmmOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066531"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#spExpr"><span class="hs-identifier hs-var">spExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066530"><span class="hs-identifier hs-var">sp_old</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066528"><span class="hs-identifier hs-var">area_off</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681066527"><span class="hs-identifier hs-var">area</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066526"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-918"></span><span>    </span><span class="hs-comment">-- Replace (CmmStackSlot area n) with an offset from Sp</span><span>
</span><span id="line-919"></span><span>
</span><span id="line-920"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var">areaToSp</span></a></span><span> </span><span id="local-6989586621681066525"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066525"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066524"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066524"><span class="hs-identifier hs-var">sp_hwm</span></a></span></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmHighStackMark"><span class="hs-identifier hs-var">CmmHighStackMark</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-921"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066525"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066524"><span class="hs-identifier hs-var">sp_hwm</span></a></span><span>
</span><span id="line-922"></span><span>    </span><span class="hs-comment">-- Replace CmmHighStackMark with the number of bytes of stack used,</span><span>
</span><span id="line-923"></span><span>    </span><span class="hs-comment">-- the sp_hwm.   See Note [Stack usage] in GHC.StgToCmm.Heap</span><span>
</span><span id="line-924"></span><span>
</span><span id="line-925"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var">areaToSp</span></a></span><span> </span><span id="local-6989586621681066521"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066521"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-type">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.MachOp.html#MO_U_Lt"><span class="hs-identifier hs-type">MO_U_Lt</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066518"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681066518"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-926"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[CmmExpr] -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#falseStackCheck"><span class="hs-identifier hs-var">falseStackCheck</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681066518"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-927"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#zeroExpr"><span class="hs-identifier hs-var">zeroExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066521"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-928"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var">areaToSp</span></a></span><span> </span><span id="local-6989586621681066515"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066515"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-type">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.MachOp.html#MO_U_Ge"><span class="hs-identifier hs-type">MO_U_Ge</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066513"><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681066513"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-929"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[CmmExpr] -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#falseStackCheck"><span class="hs-identifier hs-var">falseStackCheck</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681066513"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-930"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066515"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span>
</span><span id="line-931"></span><span>    </span><span class="hs-comment">-- Replace a stack-overflow test that cannot fail with a no-op</span><span>
</span><span id="line-932"></span><span>    </span><span class="hs-comment">-- See Note [Always false stack check]</span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#areaToSp"><span class="hs-identifier hs-var">areaToSp</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066512"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681066512"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681066512"><span class="hs-identifier hs-var">other</span></a></span><span>
</span><span id="line-935"></span><span>
</span><span id="line-936"></span><span class="hs-comment">-- | Determine whether a stack check cannot fail.</span><span>
</span><span id="line-937"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#falseStackCheck"><span class="hs-identifier hs-type">falseStackCheck</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-938"></span><span id="falseStackCheck"><span class="annot"><span class="annottext">falseStackCheck :: [CmmExpr] -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#falseStackCheck"><span class="hs-identifier hs-var hs-var">falseStackCheck</span></a></span></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-type">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.MachOp.html#MO_Sub"><span class="hs-identifier hs-type">MO_Sub</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-939"></span><span>                      </span><span class="hs-special">[</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmRegOff"><span class="hs-identifier hs-type">CmmRegOff</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-type">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#Sp"><span class="hs-identifier hs-var">Sp</span></a></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066510"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066510"><span class="hs-identifier hs-var">x_off</span></a></span></span><span>
</span><span id="line-940"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-type">CmmInt</span></a></span><span> </span><span id="local-6989586621681066508"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681066508"><span class="hs-identifier hs-var">y_lit</span></a></span></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-941"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmGlobal"><span class="hs-identifier hs-type">CmmGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg
</span><a href="GHC.Cmm.Expr.html#SpLim"><span class="hs-identifier hs-var">SpLim</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-942"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066510"><span class="hs-identifier hs-var">x_off</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681066508"><span class="hs-identifier hs-var">y_lit</span></a></span><span>
</span><span id="line-943"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#falseStackCheck"><span class="hs-identifier hs-var">falseStackCheck</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-944"></span><span>
</span><span id="line-945"></span><span class="hs-comment">-- Note [Always false stack check]</span><span>
</span><span id="line-946"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-947"></span><span class="hs-comment">-- We can optimise stack checks of the form</span><span>
</span><span id="line-948"></span><span class="hs-comment">--</span><span>
</span><span id="line-949"></span><span class="hs-comment">--   if ((Sp + x) - y &lt; SpLim) then .. else ..</span><span>
</span><span id="line-950"></span><span class="hs-comment">--</span><span>
</span><span id="line-951"></span><span class="hs-comment">-- where are non-negative integer byte offsets.  Since we know that</span><span>
</span><span id="line-952"></span><span class="hs-comment">-- SpLim &lt;= Sp (remember the stack grows downwards), this test must</span><span>
</span><span id="line-953"></span><span class="hs-comment">-- yield False if (x &gt;= y), so we can rewrite the comparison to False.</span><span>
</span><span id="line-954"></span><span class="hs-comment">-- A subsequent sinking pass will later drop the dead code.</span><span>
</span><span id="line-955"></span><span class="hs-comment">-- Optimising this away depends on knowing that SpLim &lt;= Sp, so it is</span><span>
</span><span id="line-956"></span><span class="hs-comment">-- really the job of the stack layout algorithm, hence we do it now.</span><span>
</span><span id="line-957"></span><span class="hs-comment">--</span><span>
</span><span id="line-958"></span><span class="hs-comment">-- The control flow optimiser may negate a conditional to increase</span><span>
</span><span id="line-959"></span><span class="hs-comment">-- the likelihood of a fallthrough if the branch is not taken.  But</span><span>
</span><span id="line-960"></span><span class="hs-comment">-- not every conditional is inverted as the control flow optimiser</span><span>
</span><span id="line-961"></span><span class="hs-comment">-- places some requirements on the predecessors of both branch targets.</span><span>
</span><span id="line-962"></span><span class="hs-comment">-- So we better look for the inverted comparison too.</span><span>
</span><span id="line-963"></span><span>
</span><span id="line-964"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#optStackCheck"><span class="hs-identifier hs-type">optStackCheck</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>
</span><span id="line-965"></span><span id="optStackCheck"><span class="annot"><span class="annottext">optStackCheck :: CmmNode O C -&gt; CmmNode O C
</span><a href="GHC.Cmm.LayoutStack.html#optStackCheck"><span class="hs-identifier hs-var hs-var">optStackCheck</span></a></span></span><span> </span><span id="local-6989586621681066506"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066506"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- Note [Always false stack check]</span><span>
</span><span id="line-966"></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066506"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-967"></span><span>   </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-type">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066500"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066500"><span class="hs-identifier hs-var">_true</span></a></span></span><span> </span><span id="local-6989586621681066499"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066499"><span class="hs-identifier hs-var">false</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066499"><span class="hs-identifier hs-var">false</span></a></span><span>
</span><span id="line-968"></span><span>   </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-type">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066496"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066496"><span class="hs-identifier hs-var">true</span></a></span></span><span> </span><span id="local-6989586621681066495"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066495"><span class="hs-identifier hs-var">_false</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066496"><span class="hs-identifier hs-var">true</span></a></span><span>
</span><span id="line-969"></span><span>   </span><span id="local-6989586621681066494"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066494"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066494"><span class="hs-identifier hs-var">other</span></a></span><span>
</span><span id="line-970"></span><span>
</span><span id="line-971"></span><span>
</span><span id="line-972"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-973"></span><span>
</span><span id="line-974"></span><span class="hs-comment">-- | Eliminate stores of the form</span><span>
</span><span id="line-975"></span><span class="hs-comment">--</span><span>
</span><span id="line-976"></span><span class="hs-comment">--    Sp[area+n] = r</span><span>
</span><span id="line-977"></span><span class="hs-comment">--</span><span>
</span><span id="line-978"></span><span class="hs-comment">-- when we know that r is already in the same slot as Sp[area+n].  We</span><span>
</span><span id="line-979"></span><span class="hs-comment">-- could do this in a later optimisation pass, but that would involve</span><span>
</span><span id="line-980"></span><span class="hs-comment">-- a separate analysis and we already have the information to hand</span><span>
</span><span id="line-981"></span><span class="hs-comment">-- here.  It helps clean up some extra stack stores in common cases.</span><span>
</span><span id="line-982"></span><span class="hs-comment">--</span><span>
</span><span id="line-983"></span><span class="hs-comment">-- Note that we may have to modify the StackMap as we walk through the</span><span>
</span><span id="line-984"></span><span class="hs-comment">-- code using procMiddle, since an assignment to a variable in the</span><span>
</span><span id="line-985"></span><span class="hs-comment">-- StackMap will invalidate its mapping there.</span><span>
</span><span id="line-986"></span><span class="hs-comment">--</span><span>
</span><span id="line-987"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#elimStackStores"><span class="hs-identifier hs-type">elimStackStores</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>
</span><span id="line-988"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>
</span><span id="line-989"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Area"><span class="hs-identifier hs-type">Area</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-990"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-991"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-992"></span><span id="elimStackStores"><span class="annot"><span class="annottext">elimStackStores :: StackMap
-&gt; LabelMap StackMap
-&gt; (Area -&gt; ByteOff)
-&gt; [CmmNode O O]
-&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#elimStackStores"><span class="hs-identifier hs-var hs-var">elimStackStores</span></a></span></span><span> </span><span id="local-6989586621681066493"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066493"><span class="hs-identifier hs-var">stackmap</span></a></span></span><span> </span><span id="local-6989586621681066492"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066492"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066491"><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066491"><span class="hs-identifier hs-var">area_off</span></a></span></span><span> </span><span id="local-6989586621681066490"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066490"><span class="hs-identifier hs-var">nodes</span></a></span></span><span>
</span><span id="line-993"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; [CmmNode O O] -&gt; [CmmNode O O]
</span><a href="#local-6989586621681066489"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066493"><span class="hs-identifier hs-var">stackmap</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066490"><span class="hs-identifier hs-var">nodes</span></a></span><span>
</span><span id="line-994"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-995"></span><span>    </span><span id="local-6989586621681066489"><span class="annot"><span class="annottext">go :: StackMap -&gt; [CmmNode O O] -&gt; [CmmNode O O]
</span><a href="#local-6989586621681066489"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681066488"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066488"><span class="hs-identifier hs-var">_stackmap</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-996"></span><span>    </span><span class="annot"><a href="#local-6989586621681066489"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681066487"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066487"><span class="hs-identifier hs-var">stackmap</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066486"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066486"><span class="hs-identifier hs-var">n</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681066485"><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066485"><span class="hs-identifier hs-var">ns</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-997"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066486"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-998"></span><span>         </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmStore"><span class="hs-identifier hs-type">CmmStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-type">CmmStackSlot</span></a></span><span> </span><span id="local-6989586621681066479"><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681066479"><span class="hs-identifier hs-var">area</span></a></span></span><span> </span><span id="local-6989586621681066478"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066478"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-type">CmmLocal</span></a></span><span> </span><span id="local-6989586621681066477"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066477"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-999"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681066476"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066476"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
-&gt; LocalReg -&gt; Maybe (LocalReg, ByteOff)
forall key elt. Uniquable key =&gt; UniqFM key elt -&gt; key -&gt; Maybe elt
</span><a href="GHC.Types.Unique.FM.html#lookupUFM"><span class="hs-identifier hs-var">lookupUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066487"><span class="hs-identifier hs-var">stackmap</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066477"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1000"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Area -&gt; ByteOff
</span><a href="#local-6989586621681066491"><span class="hs-identifier hs-var">area_off</span></a></span><span> </span><span class="annot"><span class="annottext">Area
</span><a href="#local-6989586621681066479"><span class="hs-identifier hs-var">area</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066478"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066476"><span class="hs-identifier hs-var">off</span></a></span><span>
</span><span id="line-1001"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; [CmmNode O O] -&gt; [CmmNode O O]
</span><a href="#local-6989586621681066489"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066487"><span class="hs-identifier hs-var">stackmap</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066485"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-1002"></span><span>         </span><span id="local-6989586621681066475"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066475"><span class="hs-identifier hs-var">_otherwise</span></a></span></span><span>
</span><span id="line-1003"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066486"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; [CmmNode O O] -&gt; [CmmNode O O]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; [CmmNode O O] -&gt; [CmmNode O O]
</span><a href="#local-6989586621681066489"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap StackMap -&gt; CmmNode O O -&gt; StackMap -&gt; StackMap
forall (e :: Extensibility) (x :: Extensibility).
LabelMap StackMap -&gt; CmmNode e x -&gt; StackMap -&gt; StackMap
</span><a href="GHC.Cmm.LayoutStack.html#procMiddle"><span class="hs-identifier hs-var">procMiddle</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066492"><span class="hs-identifier hs-var">stackmaps</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681066486"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066487"><span class="hs-identifier hs-var">stackmap</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066485"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-1004"></span><span>
</span><span id="line-1005"></span><span>
</span><span id="line-1006"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1007"></span><span class="hs-comment">-- Update info tables to include stack liveness</span><span>
</span><span id="line-1008"></span><span>
</span><span id="line-1009"></span><span>
</span><span id="line-1010"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#setInfoTableStackMap"><span class="hs-identifier hs-type">setInfoTableStackMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span>
</span><span id="line-1011"></span><span id="setInfoTableStackMap"><span class="annot"><span class="annottext">setInfoTableStackMap :: Platform -&gt; LabelMap StackMap -&gt; CmmDecl -&gt; CmmDecl
</span><a href="GHC.Cmm.LayoutStack.html#setInfoTableStackMap"><span class="hs-identifier hs-var hs-var">setInfoTableStackMap</span></a></span></span><span> </span><span id="local-6989586621681066474"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066474"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066473"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066473"><span class="hs-identifier hs-var">stackmaps</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681066471"><span class="annot"><span class="annottext">top_info :: CmmTopInfo
</span><a href="#local-6989586621681066471"><span class="hs-identifier hs-var">top_info</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.html#TopInfo"><span class="hs-identifier hs-type">TopInfo</span></a></span><span class="hs-special">{</span><span id="local-6989586621681066468"><span id="local-6989586621681066469"><span class="annot"><span class="annottext">LabelMap CmmInfoTable
CmmStackInfo
stack_info :: CmmTopInfo -&gt; CmmStackInfo
info_tbls :: CmmTopInfo -&gt; LabelMap CmmInfoTable
stack_info :: CmmStackInfo
info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#stack_info"><span class="hs-glyph hs-var hs-var hs-var hs-var">..</span></a></span></span></span><span class="hs-special">}</span><span> </span><span id="local-6989586621681066465"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681066465"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681066464"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681066464"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681066463"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681066463"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1012"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681066471"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(KeyOf LabelMap -&gt; CmmInfoTable -&gt; CmmInfoTable)
-&gt; LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a b.
IsMap map =&gt;
(KeyOf map -&gt; a -&gt; b) -&gt; map a -&gt; map b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapMapWithKey"><span class="hs-identifier hs-var">mapMapWithKey</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CmmInfoTable -&gt; CmmInfoTable
BlockId -&gt; CmmInfoTable -&gt; CmmInfoTable
</span><a href="#local-6989586621681066461"><span class="hs-identifier hs-var">fix_info</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681066469"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681066465"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681066464"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681066463"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-1013"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1014"></span><span>    </span><span id="local-6989586621681066461"><span class="annot"><span class="annottext">fix_info :: BlockId -&gt; CmmInfoTable -&gt; CmmInfoTable
</span><a href="#local-6989586621681066461"><span class="hs-identifier hs-var hs-var">fix_info</span></a></span></span><span> </span><span id="local-6989586621681066460"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066460"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681066459"><span class="annot"><span class="annottext">info_tbl :: CmmInfoTable
</span><a href="#local-6989586621681066459"><span class="hs-identifier hs-var">info_tbl</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cit_rep :: CmmInfoTable -&gt; SMRep
</span><a href="GHC.Cmm.html#cit_rep"><span class="hs-identifier hs-var">cit_rep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#StackRep"><span class="hs-identifier hs-type">StackRep</span></a></span><span> </span><span class="annot"><span class="annottext">Liveness
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1015"></span><span>       </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681066459"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cit_rep :: SMRep
</span><a href="GHC.Cmm.html#cit_rep"><span class="hs-identifier hs-var">cit_rep</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Liveness -&gt; SMRep
</span><a href="GHC.Runtime.Heap.Layout.html#StackRep"><span class="hs-identifier hs-var">StackRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; Liveness
</span><a href="#local-6989586621681066455"><span class="hs-identifier hs-var">get_liveness</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066460"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1016"></span><span>    </span><span class="annot"><a href="#local-6989586621681066461"><span class="hs-identifier hs-var">fix_info</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066454"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681066454"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681066454"><span class="hs-identifier hs-var">other</span></a></span><span>
</span><span id="line-1017"></span><span>
</span><span id="line-1018"></span><span>    </span><span class="annot"><a href="#local-6989586621681066455"><span class="hs-identifier hs-type">get_liveness</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#Liveness"><span class="hs-identifier hs-type">Liveness</span></a></span><span>
</span><span id="line-1019"></span><span>    </span><span id="local-6989586621681066455"><span class="annot"><span class="annottext">get_liveness :: BlockId -&gt; Liveness
</span><a href="#local-6989586621681066455"><span class="hs-identifier hs-var hs-var">get_liveness</span></a></span></span><span> </span><span id="local-6989586621681066453"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066453"><span class="hs-identifier hs-var">lbl</span></a></span></span><span>
</span><span id="line-1020"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap StackMap -&gt; Maybe StackMap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066453"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066473"><span class="hs-identifier hs-var">stackmaps</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1021"></span><span>          </span><span class="annot"><span class="annottext">Maybe StackMap
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Liveness
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;setInfoTableStackMap&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066453"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681066469"><span class="hs-identifier hs-var">info_tbls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1022"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066452"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066452"><span class="hs-identifier hs-var">sm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; StackMap -&gt; Liveness
</span><a href="GHC.Cmm.LayoutStack.html#stackMapToLiveness"><span class="hs-identifier hs-var">stackMapToLiveness</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066474"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066452"><span class="hs-identifier hs-var">sm</span></a></span><span>
</span><span id="line-1023"></span><span>
</span><span id="line-1024"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#setInfoTableStackMap"><span class="hs-identifier hs-var">setInfoTableStackMap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066450"><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681066450"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681066450"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-1025"></span><span>
</span><span id="line-1026"></span><span>
</span><span id="line-1027"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#stackMapToLiveness"><span class="hs-identifier hs-type">stackMapToLiveness</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#Liveness"><span class="hs-identifier hs-type">Liveness</span></a></span><span>
</span><span id="line-1028"></span><span id="stackMapToLiveness"><span class="annot"><span class="annottext">stackMapToLiveness :: Platform -&gt; StackMap -&gt; Liveness
</span><a href="GHC.Cmm.LayoutStack.html#stackMapToLiveness"><span class="hs-identifier hs-var hs-var">stackMapToLiveness</span></a></span></span><span> </span><span id="local-6989586621681066449"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066449"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span class="hs-special">{</span><span id="local-6989586621681066445"><span id="local-6989586621681066446"><span id="local-6989586621681066447"><span id="local-6989586621681066448"><span class="annot"><span class="annottext">ByteOff
UniqFM LocalReg (LocalReg, ByteOff)
sm_regs :: UniqFM LocalReg (LocalReg, ByteOff)
sm_ret_off :: ByteOff
sm_args :: ByteOff
sm_sp :: ByteOff
sm_regs :: StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
sm_ret_off :: StackMap -&gt; ByteOff
sm_args :: StackMap -&gt; ByteOff
sm_sp :: StackMap -&gt; ByteOff
</span><a href="#local-6989586621681066445"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1029"></span><span>   </span><span class="annot"><span class="annottext">Liveness -&gt; Liveness
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">(Liveness -&gt; Liveness) -&gt; Liveness -&gt; Liveness
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Array ByteOff Bool -&gt; Liveness
forall i e. Array i e -&gt; [e]
</span><a href="../../base/src/GHC.Arr.html#elems"><span class="hs-identifier hs-var">Array.elems</span></a></span><span> </span><span class="annot"><span class="annottext">(Array ByteOff Bool -&gt; Liveness) -&gt; Array ByteOff Bool -&gt; Liveness
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1030"></span><span>        </span><span class="annot"><span class="annottext">(Bool -&gt; Bool -&gt; Bool)
-&gt; Bool
-&gt; (ByteOff, ByteOff)
-&gt; [(ByteOff, Bool)]
-&gt; Array ByteOff Bool
forall i e a.
Ix i =&gt;
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; [(i, a)] -&gt; Array i e
</span><a href="../../base/src/GHC.Arr.html#accumArray"><span class="hs-identifier hs-var">accumArray</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066444"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681066444"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681066444"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066449"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066446"><span class="hs-identifier hs-var">sm_ret_off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span>
</span><span id="line-1031"></span><span>                                     </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066449"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066448"><span class="hs-identifier hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066447"><span class="hs-identifier hs-var">sm_args</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(ByteOff, Bool)]
</span><a href="#local-6989586621681066443"><span class="hs-identifier hs-var">live_words</span></a></span><span>
</span><span id="line-1032"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-1033"></span><span>     </span><span id="local-6989586621681066443"><span class="annot"><span class="annottext">live_words :: [(ByteOff, Bool)]
</span><a href="#local-6989586621681066443"><span class="hs-identifier hs-var hs-var">live_words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066449"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066442"><span class="hs-identifier hs-var">off</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-1034"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066441"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066441"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681066442"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066442"><span class="hs-identifier hs-var">off</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff) -&gt; [(LocalReg, ByteOff)]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="#local-6989586621681066445"><span class="hs-identifier hs-var">sm_regs</span></a></span><span>
</span><span id="line-1035"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; Bool
</span><a href="GHC.Cmm.Type.html#isGcPtrType"><span class="hs-identifier hs-var">isGcPtrType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#localRegType"><span class="hs-identifier hs-var">localRegType</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066441"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1036"></span><span>                   </span><span class="hs-comment">-- See Note [Unique Determinism and code generation]</span><span>
</span><span id="line-1037"></span><span>
</span><span id="line-1038"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1039"></span><span class="hs-comment">-- Pass 2</span><span>
</span><span id="line-1040"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1041"></span><span>
</span><span id="line-1042"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#insertReloadsAsNeeded"><span class="hs-identifier hs-type">insertReloadsAsNeeded</span></a></span><span>
</span><span id="line-1043"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-1044"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span>
</span><span id="line-1045"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span>
</span><span id="line-1046"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-1047"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1048"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1049"></span><span id="insertReloadsAsNeeded"><span class="annot"><span class="annottext">insertReloadsAsNeeded :: DynFlags
-&gt; ProcPointSet
-&gt; LabelMap StackMap
-&gt; BlockId
-&gt; [CmmBlock]
-&gt; UniqSM [CmmBlock]
</span><a href="GHC.Cmm.LayoutStack.html#insertReloadsAsNeeded"><span class="hs-identifier hs-var hs-var">insertReloadsAsNeeded</span></a></span></span><span> </span><span id="local-6989586621681066438"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066438"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066437"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066437"><span class="hs-identifier hs-var">procpoints</span></a></span></span><span> </span><span id="local-6989586621681066436"><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066436"><span class="hs-identifier hs-var">final_stackmaps</span></a></span></span><span> </span><span id="local-6989586621681066435"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066435"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span id="local-6989586621681066434"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066434"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1050"></span><span>    </span><span class="annot"><span class="annottext">CmmGraph -&gt; [CmmBlock]
</span><a href="GHC.Cmm.Utils.html#toBlockList"><span class="hs-identifier hs-var">toBlockList</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmGraph -&gt; [CmmBlock])
-&gt; ((CmmGraph, BlockEntryLiveness LocalReg) -&gt; CmmGraph)
-&gt; (CmmGraph, BlockEntryLiveness LocalReg)
-&gt; [CmmBlock]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmGraph, BlockEntryLiveness LocalReg) -&gt; CmmGraph
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">((CmmGraph, BlockEntryLiveness LocalReg) -&gt; [CmmBlock])
-&gt; UniqSM (CmmGraph, BlockEntryLiveness LocalReg)
-&gt; UniqSM [CmmBlock]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-1051"></span><span>        </span><span class="annot"><span class="annottext">DataflowLattice CmmLocalLive
-&gt; RewriteFun CmmLocalLive
-&gt; CmmGraph
-&gt; BlockEntryLiveness LocalReg
-&gt; UniqSM (CmmGraph, BlockEntryLiveness LocalReg)
forall f.
DataflowLattice f
-&gt; RewriteFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; UniqSM (CmmGraph, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#rewriteCmmBwd"><span class="hs-identifier hs-var">rewriteCmmBwd</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice CmmLocalLive
forall r. Ord r =&gt; DataflowLattice (CmmLive r)
</span><a href="GHC.Cmm.Liveness.html#liveLattice"><span class="hs-identifier hs-var">liveLattice</span></a></span><span> </span><span class="annot"><span class="annottext">RewriteFun CmmLocalLive
</span><a href="#local-6989586621681066429"><span class="hs-identifier hs-var">rewriteCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; [CmmBlock] -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockList"><span class="hs-identifier hs-var">ofBlockList</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066435"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681066434"><span class="hs-identifier hs-var">blocks</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-1052"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1053"></span><span>    </span><span class="annot"><a href="#local-6989586621681066429"><span class="hs-identifier hs-type">rewriteCC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#RewriteFun"><span class="hs-identifier hs-type">RewriteFun</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html#CmmLocalLive"><span class="hs-identifier hs-type">CmmLocalLive</span></a></span><span>
</span><span id="line-1054"></span><span>    </span><span id="local-6989586621681066429"><span class="annot"><span class="annottext">rewriteCC :: RewriteFun CmmLocalLive
</span><a href="#local-6989586621681066429"><span class="hs-identifier hs-var hs-var">rewriteCC</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BlockCC"><span class="hs-identifier hs-type">BlockCC</span></a></span><span> </span><span id="local-6989586621681066411"><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066411"><span class="hs-identifier hs-var">e_node</span></a></span></span><span> </span><span id="local-6989586621681066410"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066410"><span class="hs-identifier hs-var">middle0</span></a></span></span><span> </span><span id="local-6989586621681066409"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066409"><span class="hs-identifier hs-var">x_node</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681066408"><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066408"><span class="hs-identifier hs-var">fact_base0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1055"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066407"><span class="annot"><span class="annottext">entry_label :: BlockId
</span><a href="#local-6989586621681066407"><span class="hs-identifier hs-var hs-var">entry_label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode C O -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066411"><span class="hs-identifier hs-var">e_node</span></a></span><span>
</span><span id="line-1056"></span><span>            </span><span id="local-6989586621681066405"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681066405"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066438"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1057"></span><span>            </span><span id="local-6989586621681066404"><span class="annot"><span class="annottext">stackmap :: StackMap
</span><a href="#local-6989586621681066404"><span class="hs-identifier hs-var hs-var">stackmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap StackMap -&gt; Maybe StackMap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066407"><span class="hs-identifier hs-var">entry_label</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap StackMap
</span><a href="#local-6989586621681066436"><span class="hs-identifier hs-var">final_stackmaps</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1058"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681066403"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066403"><span class="hs-identifier hs-var">sm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066403"><span class="hs-identifier hs-var">sm</span></a></span><span>
</span><span id="line-1059"></span><span>                </span><span class="annot"><span class="annottext">Maybe StackMap
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; StackMap
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;insertReloadsAsNeeded: rewriteCC: stackmap&quot;</span></span><span>
</span><span id="line-1060"></span><span>
</span><span id="line-1061"></span><span>            </span><span class="hs-comment">-- Merge the liveness from successor blocks and analyse the last</span><span>
</span><span id="line-1062"></span><span>            </span><span class="hs-comment">-- node.</span><span>
</span><span id="line-1063"></span><span>            </span><span id="local-6989586621681066402"><span class="annot"><span class="annottext">joined :: CmmLocalLive
</span><a href="#local-6989586621681066402"><span class="hs-identifier hs-var hs-var">joined</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CmmNode O C -&gt; CmmLocalLive -&gt; CmmLocalLive
forall r n.
(DefinerOfRegs r n, UserOfRegs r n) =&gt;
DynFlags -&gt; n -&gt; CmmLive r -&gt; CmmLive r
</span><a href="GHC.Cmm.Liveness.html#gen_kill"><span class="hs-identifier hs-var">gen_kill</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066438"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066409"><span class="hs-identifier hs-var">x_node</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmLocalLive -&gt; CmmLocalLive) -&gt; CmmLocalLive -&gt; CmmLocalLive
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span>
</span><span id="line-1064"></span><span>                         </span><span class="annot"><span class="annottext">DataflowLattice CmmLocalLive
-&gt; CmmNode O C -&gt; BlockEntryLiveness LocalReg -&gt; CmmLocalLive
forall (n :: Extensibility -&gt; Extensibility -&gt; *) f
       (e :: Extensibility).
NonLocal n =&gt;
DataflowLattice f -&gt; n e C -&gt; FactBase f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#joinOutFacts"><span class="hs-identifier hs-var">joinOutFacts</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice CmmLocalLive
forall r. Ord r =&gt; DataflowLattice (CmmLive r)
</span><a href="GHC.Cmm.Liveness.html#liveLattice"><span class="hs-identifier hs-var">liveLattice</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066409"><span class="hs-identifier hs-var">x_node</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066408"><span class="hs-identifier hs-var">fact_base0</span></a></span><span>
</span><span id="line-1065"></span><span>            </span><span class="hs-comment">-- What is live at the start of middle0.</span><span>
</span><span id="line-1066"></span><span>            </span><span id="local-6989586621681066398"><span class="annot"><span class="annottext">live_at_middle0 :: CmmLocalLive
</span><a href="#local-6989586621681066398"><span class="hs-identifier hs-var hs-var">live_at_middle0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmNode O O -&gt; CmmLocalLive -&gt; CmmLocalLive)
-&gt; Block CmmNode O O -&gt; CmmLocalLive -&gt; CmmLocalLive
forall f. (CmmNode O O -&gt; f -&gt; f) -&gt; Block CmmNode O O -&gt; f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#foldNodesBwdOO"><span class="hs-identifier hs-var">foldNodesBwdOO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmNode O O -&gt; CmmLocalLive -&gt; CmmLocalLive
forall r n.
(DefinerOfRegs r n, UserOfRegs r n) =&gt;
DynFlags -&gt; n -&gt; CmmLive r -&gt; CmmLive r
</span><a href="GHC.Cmm.Liveness.html#gen_kill"><span class="hs-identifier hs-var">gen_kill</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066438"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066410"><span class="hs-identifier hs-var">middle0</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066402"><span class="hs-identifier hs-var">joined</span></a></span><span>
</span><span id="line-1067"></span><span>
</span><span id="line-1068"></span><span>            </span><span class="hs-comment">-- If this is a procpoint we need to add the reloads, but only if</span><span>
</span><span id="line-1069"></span><span>            </span><span class="hs-comment">-- they're actually live. Furthermore, nothing is live at the entry</span><span>
</span><span id="line-1070"></span><span>            </span><span class="hs-comment">-- to a proc point.</span><span>
</span><span id="line-1071"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681066396"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066396"><span class="hs-identifier hs-var">middle1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066395"><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066395"><span class="hs-identifier hs-var">live_with_reloads</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1072"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681066407"><span class="hs-identifier hs-var">entry_label</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-operator hs-var">`setMember`</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681066437"><span class="hs-identifier hs-var">procpoints</span></a></span><span>
</span><span id="line-1073"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066394"><span class="annot"><span class="annottext">reloads :: [CmmNode O O]
</span><a href="#local-6989586621681066394"><span class="hs-identifier hs-var hs-var">reloads</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; StackMap -&gt; CmmLocalLive -&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#insertReloads"><span class="hs-identifier hs-var">insertReloads</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066405"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066404"><span class="hs-identifier hs-var">stackmap</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066398"><span class="hs-identifier hs-var">live_at_middle0</span></a></span><span>
</span><span id="line-1074"></span><span>                  </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CmmNode O O -&gt; Block CmmNode O O -&gt; Block CmmNode O O)
-&gt; Block CmmNode O O -&gt; [CmmNode O O] -&gt; Block CmmNode O O
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; Block CmmNode O O -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
n O O -&gt; Block n O x -&gt; Block n O x
</span><a href="GHC.Cmm.Dataflow.Block.html#blockCons"><span class="hs-identifier hs-var">blockCons</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066410"><span class="hs-identifier hs-var">middle0</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmNode O O]
</span><a href="#local-6989586621681066394"><span class="hs-identifier hs-var">reloads</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
forall a. Set a
</span><a href="GHC.Cmm.Expr.html#emptyRegSet"><span class="hs-identifier hs-var">emptyRegSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1075"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1076"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066410"><span class="hs-identifier hs-var">middle0</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066398"><span class="hs-identifier hs-var">live_at_middle0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1077"></span><span>
</span><span id="line-1078"></span><span>            </span><span class="hs-comment">-- Final liveness for this block.</span><span>
</span><span id="line-1079"></span><span>            </span><span class="hs-glyph">!</span><span id="local-6989586621681066391"><span class="annot"><span class="annottext">fact_base2 :: BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066391"><span class="hs-identifier hs-var hs-var">fact_base2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CmmLocalLive -&gt; BlockEntryLiveness LocalReg
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSingleton"><span class="hs-identifier hs-var">mapSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681066407"><span class="hs-identifier hs-var">entry_label</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066395"><span class="hs-identifier hs-var">live_with_reloads</span></a></span><span>
</span><span id="line-1080"></span><span>
</span><span id="line-1081"></span><span>        </span><span class="annot"><span class="annottext">(CmmBlock, BlockEntryLiveness LocalReg)
-&gt; UniqSM (CmmBlock, BlockEntryLiveness LocalReg)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O -&gt; Block CmmNode O O -&gt; CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
n C O -&gt; Block n O O -&gt; n O C -&gt; Block n C C
</span><a href="GHC.Cmm.Dataflow.Block.html#BlockCC"><span class="hs-identifier hs-var">BlockCC</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066411"><span class="hs-identifier hs-var">e_node</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066396"><span class="hs-identifier hs-var">middle1</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066409"><span class="hs-identifier hs-var">x_node</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness LocalReg
</span><a href="#local-6989586621681066391"><span class="hs-identifier hs-var">fact_base2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1082"></span><span>
</span><span id="line-1083"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#insertReloads"><span class="hs-identifier hs-type">insertReloads</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html#CmmLocalLive"><span class="hs-identifier hs-type">CmmLocalLive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1084"></span><span id="insertReloads"><span class="annot"><span class="annottext">insertReloads :: Platform -&gt; StackMap -&gt; CmmLocalLive -&gt; [CmmNode O O]
</span><a href="GHC.Cmm.LayoutStack.html#insertReloads"><span class="hs-identifier hs-var hs-var">insertReloads</span></a></span></span><span> </span><span id="local-6989586621681066390"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066390"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066389"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066389"><span class="hs-identifier hs-var">stackmap</span></a></span></span><span> </span><span id="local-6989586621681066388"><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066388"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1085"></span><span>     </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmAssign"><span class="hs-identifier hs-var">CmmAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066387"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1086"></span><span>                 </span><span class="hs-comment">-- This cmmOffset basically corresponds to manifesting</span><span>
</span><span id="line-1087"></span><span>                 </span><span class="hs-comment">-- @CmmStackSlot Old sp_off@, see Note [SP old/young offsets]</span><span>
</span><span id="line-1088"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffset"><span class="hs-identifier hs-var">cmmOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066390"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#spExpr"><span class="hs-identifier hs-var">spExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066386"><span class="hs-identifier hs-var">sp_off</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066385"><span class="hs-identifier hs-var">reg_off</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1089"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#localRegType"><span class="hs-identifier hs-var">localRegType</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066387"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1090"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066387"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066387"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066385"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066385"><span class="hs-identifier hs-var">reg_off</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; [(LocalReg, ByteOff)]
</span><a href="GHC.Cmm.LayoutStack.html#stackSlotRegs"><span class="hs-identifier hs-var">stackSlotRegs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066389"><span class="hs-identifier hs-var">stackmap</span></a></span><span>
</span><span id="line-1091"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066387"><span class="hs-identifier hs-var">reg</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; CmmLocalLive -&gt; Bool
forall r. Ord r =&gt; r -&gt; RegSet r -&gt; Bool
</span><a href="GHC.Cmm.Expr.html#elemRegSet"><span class="hs-operator hs-var">`elemRegSet`</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLocalLive
</span><a href="#local-6989586621681066388"><span class="hs-identifier hs-var">live</span></a></span><span>
</span><span id="line-1092"></span><span>     </span><span class="hs-special">]</span><span>
</span><span id="line-1093"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-1094"></span><span>     </span><span id="local-6989586621681066386"><span class="annot"><span class="annottext">sp_off :: ByteOff
</span><a href="#local-6989586621681066386"><span class="hs-identifier hs-var hs-var">sp_off</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackMap -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#sm_sp"><span class="hs-identifier hs-var hs-var">sm_sp</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066389"><span class="hs-identifier hs-var">stackmap</span></a></span><span>
</span><span id="line-1095"></span><span>
</span><span id="line-1096"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1097"></span><span class="hs-comment">-- Lowering safe foreign calls</span><span>
</span><span id="line-1098"></span><span>
</span><span id="line-1099"></span><span class="hs-comment">{-
Note [Lower safe foreign calls]

We start with

   Sp[young(L1)] = L1
 ,-----------------------
 | r1 = foo(x,y,z) returns to L1
 '-----------------------
 L1:
   R1 = r1 -- copyIn, inserted by mkSafeCall
   ...

the stack layout algorithm will arrange to save and reload everything
live across the call.  Our job now is to expand the call so we get

   Sp[young(L1)] = L1
 ,-----------------------
 | SAVE_THREAD_STATE()
 | token = suspendThread(BaseReg, interruptible)
 | r = foo(x,y,z)
 | BaseReg = resumeThread(token)
 | LOAD_THREAD_STATE()
 | R1 = r  -- copyOut
 | jump Sp[0]
 '-----------------------
 L1:
   r = R1 -- copyIn, inserted by mkSafeCall
   ...

Note the copyOut, which saves the results in the places that L1 is
expecting them (see Note [safe foreign call convention]). Note also
that safe foreign call is replace by an unsafe one in the Cmm graph.
-}</span><span>
</span><span id="line-1133"></span><span>
</span><span id="line-1134"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#lowerSafeForeignCall"><span class="hs-identifier hs-type">lowerSafeForeignCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>
</span><span id="line-1135"></span><span id="lowerSafeForeignCall"><span class="annot"><span class="annottext">lowerSafeForeignCall :: DynFlags -&gt; CmmBlock -&gt; UniqSM CmmBlock
</span><a href="GHC.Cmm.LayoutStack.html#lowerSafeForeignCall"><span class="hs-identifier hs-var hs-var">lowerSafeForeignCall</span></a></span></span><span> </span><span id="local-6989586621681066384"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066384"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681066383"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066383"><span class="hs-identifier hs-var">block</span></a></span></span><span>
</span><span id="line-1136"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066382"><span class="annot"><span class="annottext">entry :: CmmNode C O
</span><a href="#local-6989586621681066382"><span class="hs-identifier hs-var">entry</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-type">CmmEntry</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681066379"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066379"><span class="hs-identifier hs-var">tscp</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066378"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066378"><span class="hs-identifier hs-var">middle</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681066359"><span id="local-6989586621681066360"><span id="local-6989586621681066361"><span id="local-6989586621681066362"><span id="local-6989586621681066363"><span id="local-6989586621681066364"><span id="local-6989586621681066365"><span class="annot"><span class="annottext">Bool
ByteOff
[CmmExpr]
[LocalReg]
BlockId
ForeignTarget
intrbl :: Bool
ret_off :: ByteOff
ret_args :: ByteOff
succ :: BlockId
args :: [CmmExpr]
res :: [LocalReg]
tgt :: ForeignTarget
tgt :: CmmNode O C -&gt; ForeignTarget
succ :: CmmNode O C -&gt; BlockId
ret_off :: CmmNode O C -&gt; ByteOff
ret_args :: CmmNode O C -&gt; ByteOff
res :: CmmNode O C -&gt; [LocalReg]
intrbl :: CmmNode O C -&gt; Bool
args :: CmmNode O C -&gt; [CmmExpr]
</span><a href="#local-6989586621681066359"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (CmmNode C O, Block CmmNode O O, CmmNode O C)
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n C C -&gt; (n C O, Block n O O, n O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplit"><span class="hs-identifier hs-var">blockSplit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066383"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-1137"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1138"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066358"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066384"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1139"></span><span>    </span><span class="hs-comment">-- Both 'id' and 'new_base' are KindNonPtr because they're</span><span>
</span><span id="line-1140"></span><span>    </span><span class="hs-comment">-- RTS-only objects and are not subject to garbage collection</span><span>
</span><span id="line-1141"></span><span>    </span><span id="local-6989586621681066357"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066357"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; UniqSM LocalReg
forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var">newTemp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1142"></span><span>    </span><span id="local-6989586621681066355"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066355"><span class="hs-identifier hs-var">new_base</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; UniqSM LocalReg
forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var">newTemp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#cmmRegType"><span class="hs-identifier hs-var">cmmRegType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="GHC.Cmm.Expr.html#baseReg"><span class="hs-identifier hs-var">baseReg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1143"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681066352"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066352"><span class="hs-identifier hs-var">caller_save</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066351"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066351"><span class="hs-identifier hs-var">caller_load</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; (CmmAGraph, CmmAGraph)
</span><a href="GHC.StgToCmm.Utils.html#callerSaveVolatileRegs"><span class="hs-identifier hs-var">callerSaveVolatileRegs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066384"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1144"></span><span>    </span><span id="local-6989586621681066350"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066350"><span class="hs-identifier hs-var">save_state_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UniqSM CmmAGraph
forall (m :: * -&gt; *). MonadUnique m =&gt; DynFlags -&gt; m CmmAGraph
</span><a href="GHC.StgToCmm.Foreign.html#saveThreadState"><span class="hs-identifier hs-var">saveThreadState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066384"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1145"></span><span>    </span><span id="local-6989586621681066349"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066349"><span class="hs-identifier hs-var">load_state_code</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UniqSM CmmAGraph
forall (m :: * -&gt; *). MonadUnique m =&gt; DynFlags -&gt; m CmmAGraph
</span><a href="GHC.StgToCmm.Foreign.html#loadThreadState"><span class="hs-identifier hs-var">loadThreadState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066384"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-1146"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681066348"><span class="annot"><span class="annottext">suspend :: CmmAGraph
</span><a href="#local-6989586621681066348"><span class="hs-identifier hs-var hs-var">suspend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066350"><span class="hs-identifier hs-var">save_state_code</span></a></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1147"></span><span>                  </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066352"><span class="hs-identifier hs-var">caller_save</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1148"></span><span>                  </span><span class="annot"><span class="annottext">CmmNode O O -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkMiddle"><span class="hs-identifier hs-var">mkMiddle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; LocalReg -&gt; Bool -&gt; CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#callSuspendThread"><span class="hs-identifier hs-var">callSuspendThread</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066357"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681066359"><span class="hs-identifier hs-var">intrbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1149"></span><span>        </span><span id="local-6989586621681066344"><span class="annot"><span class="annottext">midCall :: CmmAGraph
</span><a href="#local-6989586621681066344"><span class="hs-identifier hs-var hs-var">midCall</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ForeignTarget -&gt; [LocalReg] -&gt; [CmmExpr] -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkUnsafeCall"><span class="hs-identifier hs-var">mkUnsafeCall</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignTarget
</span><a href="#local-6989586621681066365"><span class="hs-identifier hs-var">tgt</span></a></span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066364"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmExpr]
</span><a href="#local-6989586621681066363"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-1150"></span><span>        </span><span id="local-6989586621681066342"><span class="annot"><span class="annottext">resume :: CmmAGraph
</span><a href="#local-6989586621681066342"><span class="hs-identifier hs-var hs-var">resume</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkMiddle"><span class="hs-identifier hs-var">mkMiddle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; LocalReg -&gt; CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#callResumeThread"><span class="hs-identifier hs-var">callResumeThread</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066355"><span class="hs-identifier hs-var">new_base</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066357"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1151"></span><span>                  </span><span class="hs-comment">-- Assign the result to BaseReg: we</span><span>
</span><span id="line-1152"></span><span>                  </span><span class="hs-comment">-- might now have a different Capability!</span><span>
</span><span id="line-1153"></span><span>                  </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkAssign"><span class="hs-identifier hs-var">mkAssign</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="GHC.Cmm.Expr.html#baseReg"><span class="hs-identifier hs-var">baseReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066355"><span class="hs-identifier hs-var">new_base</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1154"></span><span>                  </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066351"><span class="hs-identifier hs-var">caller_load</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1155"></span><span>                  </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066349"><span class="hs-identifier hs-var">load_state_code</span></a></span><span>
</span><span id="line-1156"></span><span>
</span><span id="line-1157"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066339"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681066339"><span class="hs-identifier hs-var">regs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066338"><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066338"><span class="hs-identifier hs-var">copyout</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1158"></span><span>             </span><span class="annot"><span class="annottext">DynFlags
-&gt; Convention
-&gt; Transfer
-&gt; Area
-&gt; [CmmExpr]
-&gt; ByteOff
-&gt; [CmmExpr]
-&gt; (ByteOff, [GlobalReg], CmmAGraph)
</span><a href="GHC.Cmm.Graph.html#copyOutOflow"><span class="hs-identifier hs-var">copyOutOflow</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681066384"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Convention
</span><a href="GHC.Cmm.Node.html#NativeReturn"><span class="hs-identifier hs-var">NativeReturn</span></a></span><span> </span><span class="annot"><span class="annottext">Transfer
</span><a href="GHC.Cmm.Graph.html#Jump"><span class="hs-identifier hs-var">Jump</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; Area
</span><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-var">Young</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066362"><span class="hs-identifier hs-var">succ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1159"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LocalReg -&gt; CmmExpr) -&gt; [LocalReg] -&gt; [CmmExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmReg -&gt; CmmExpr) -&gt; (LocalReg -&gt; CmmReg) -&gt; LocalReg -&gt; CmmExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LocalReg]
</span><a href="#local-6989586621681066364"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1160"></span><span>                            </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066360"><span class="hs-identifier hs-var">ret_off</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1161"></span><span>
</span><span id="line-1162"></span><span>        </span><span class="hs-comment">-- NB. after resumeThread returns, the top-of-stack probably contains</span><span>
</span><span id="line-1163"></span><span>        </span><span class="hs-comment">-- the stack frame for succ, but it might not: if the current thread</span><span>
</span><span id="line-1164"></span><span>        </span><span class="hs-comment">-- received an exception during the call, then the stack might be</span><span>
</span><span id="line-1165"></span><span>        </span><span class="hs-comment">-- different.  Hence we continue by jumping to the top stack frame,</span><span>
</span><span id="line-1166"></span><span>        </span><span class="hs-comment">-- not by jumping to succ.</span><span>
</span><span id="line-1167"></span><span>        </span><span id="local-6989586621681066334"><span class="annot"><span class="annottext">jump :: CmmNode O C
</span><a href="#local-6989586621681066334"><span class="hs-identifier hs-var hs-var">jump</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmCall :: CmmExpr
-&gt; Maybe BlockId
-&gt; [GlobalReg]
-&gt; ByteOff
-&gt; ByteOff
-&gt; ByteOff
-&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_target :: CmmExpr
</span><a href="GHC.Cmm.Node.html#cml_target"><span class="hs-identifier hs-var">cml_target</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.Info.html#entryCode"><span class="hs-identifier hs-var">entryCode</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; CmmExpr -&gt; CmmExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1168"></span><span>                                         </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#spExpr"><span class="hs-identifier hs-var">spExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1169"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cml_cont :: Maybe BlockId
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Maybe BlockId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681066362"><span class="hs-identifier hs-var">succ</span></a></span><span>
</span><span id="line-1170"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cml_args_regs :: [GlobalReg]
</span><a href="GHC.Cmm.Node.html#cml_args_regs"><span class="hs-identifier hs-var">cml_args_regs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681066339"><span class="hs-identifier hs-var">regs</span></a></span><span>
</span><span id="line-1171"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cml_args :: ByteOff
</span><a href="GHC.Cmm.Node.html#cml_args"><span class="hs-identifier hs-var">cml_args</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Width -&gt; ByteOff
</span><a href="GHC.Cmm.Type.html#widthInBytes"><span class="hs-identifier hs-var">widthInBytes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066358"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1172"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cml_ret_args :: ByteOff
</span><a href="GHC.Cmm.Node.html#cml_ret_args"><span class="hs-identifier hs-var">cml_ret_args</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066361"><span class="hs-identifier hs-var">ret_args</span></a></span><span>
</span><span id="line-1173"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cml_ret_off :: ByteOff
</span><a href="GHC.Cmm.Node.html#cml_ret_off"><span class="hs-identifier hs-var">cml_ret_off</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066360"><span class="hs-identifier hs-var">ret_off</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1174"></span><span>
</span><span id="line-1175"></span><span>    </span><span id="local-6989586621681066330"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681066330"><span class="hs-identifier hs-var">graph'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmAGraphScoped -&gt; UniqSM CmmGraph
</span><a href="GHC.Cmm.Graph.html#lgraphOfAGraph"><span class="hs-identifier hs-var">lgraphOfAGraph</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066348"><span class="hs-identifier hs-var">suspend</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1176"></span><span>                               </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066344"><span class="hs-identifier hs-var">midCall</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1177"></span><span>                               </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066342"><span class="hs-identifier hs-var">resume</span></a></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1178"></span><span>                               </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="#local-6989586621681066338"><span class="hs-identifier hs-var">copyout</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; CmmAGraph -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span>
</span><span id="line-1179"></span><span>                               </span><span class="annot"><span class="annottext">CmmNode O C -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkLast"><span class="hs-identifier hs-var">mkLast</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066334"><span class="hs-identifier hs-var">jump</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681066379"><span class="hs-identifier hs-var">tscp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1180"></span><span>
</span><span id="line-1181"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; [CmmBlock]
</span><a href="GHC.Cmm.Utils.html#toBlockList"><span class="hs-identifier hs-var">toBlockList</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681066330"><span class="hs-identifier hs-var">graph'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1182"></span><span>      </span><span class="hs-special">[</span><span id="local-6989586621681066327"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066327"><span class="hs-identifier hs-var">one</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066326"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066326"><span class="hs-identifier hs-var">middle'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681066325"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066325"><span class="hs-identifier hs-var">last</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (CmmNode C O, Block CmmNode O O, CmmNode O C)
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n C C -&gt; (n C O, Block n O O, n O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplit"><span class="hs-identifier hs-var">blockSplit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066327"><span class="hs-identifier hs-var">one</span></a></span><span>
</span><span id="line-1183"></span><span>               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; UniqSM CmmBlock
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O -&gt; Block CmmNode O O -&gt; CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
n C O -&gt; Block n O O -&gt; n O C -&gt; Block n C C
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoin"><span class="hs-identifier hs-var">blockJoin</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681066382"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066378"><span class="hs-identifier hs-var">middle</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; Block CmmNode O O -&gt; Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility) (x :: Extensibility).
Block n e O -&gt; Block n O x -&gt; Block n e x
</span><a href="GHC.Cmm.Dataflow.Block.html#blockAppend"><span class="hs-operator hs-var">`blockAppend`</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681066326"><span class="hs-identifier hs-var">middle'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681066325"><span class="hs-identifier hs-var">last</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1184"></span><span>      </span><span class="annot"><span class="annottext">[CmmBlock]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; UniqSM CmmBlock
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lowerSafeForeignCall0&quot;</span></span><span>
</span><span id="line-1185"></span><span>
</span><span id="line-1186"></span><span>  </span><span class="hs-comment">-- Block doesn't end in a safe foreign call:</span><span>
</span><span id="line-1187"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; UniqSM CmmBlock
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681066383"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-1188"></span><span>
</span><span id="line-1189"></span><span>
</span><span id="line-1190"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#foreignLbl"><span class="hs-identifier hs-type">foreignLbl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-1191"></span><span id="foreignLbl"><span class="annot"><span class="annottext">foreignLbl :: FastString -&gt; CmmExpr
</span><a href="GHC.Cmm.LayoutStack.html#foreignLbl"><span class="hs-identifier hs-var hs-var">foreignLbl</span></a></span></span><span> </span><span id="local-6989586621681066322"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681066322"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString
-&gt; Maybe ByteOff -&gt; ForeignLabelSource -&gt; FunctionOrData -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkForeignLabel"><span class="hs-identifier hs-var">mkForeignLabel</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681066322"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteOff
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLabelSource
</span><a href="GHC.Cmm.CLabel.html#ForeignLabelInExternalPackage"><span class="hs-identifier hs-var">ForeignLabelInExternalPackage</span></a></span><span> </span><span class="annot"><span class="annottext">FunctionOrData
</span><a href="GHC.Types.Basic.html#IsFunction"><span class="hs-identifier hs-var">IsFunction</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1192"></span><span>
</span><span id="line-1193"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#callSuspendThread"><span class="hs-identifier hs-type">callSuspendThread</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span>
</span><span id="line-1194"></span><span id="callSuspendThread"><span class="annot"><span class="annottext">callSuspendThread :: Platform -&gt; LocalReg -&gt; Bool -&gt; CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#callSuspendThread"><span class="hs-identifier hs-var hs-var">callSuspendThread</span></a></span></span><span> </span><span id="local-6989586621681066317"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066317"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066316"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066316"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span id="local-6989586621681066315"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681066315"><span class="hs-identifier hs-var">intrbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1195"></span><span>  </span><span class="annot"><span class="annottext">ForeignTarget -&gt; [LocalReg] -&gt; [CmmExpr] -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmUnsafeForeignCall"><span class="hs-identifier hs-var">CmmUnsafeForeignCall</span></a></span><span>
</span><span id="line-1196"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; ForeignConvention -&gt; ForeignTarget
</span><a href="GHC.Cmm.Node.html#ForeignTarget"><span class="hs-identifier hs-var">ForeignTarget</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; CmmExpr
</span><a href="GHC.Cmm.LayoutStack.html#foreignLbl"><span class="hs-identifier hs-var">foreignLbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;suspendThread&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1197"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CCallConv
-&gt; [ForeignHint]
-&gt; [ForeignHint]
-&gt; CmmReturnInfo
-&gt; ForeignConvention
</span><a href="GHC.Cmm.Node.html#ForeignConvention"><span class="hs-identifier hs-var">ForeignConvention</span></a></span><span> </span><span class="annot"><span class="annottext">CCallConv
</span><a href="GHC.Types.ForeignCall.html#CCallConv"><span class="hs-identifier hs-var">CCallConv</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#NoHint"><span class="hs-identifier hs-var">NoHint</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CmmReturnInfo
</span><a href="GHC.Cmm.Node.html#CmmMayReturn"><span class="hs-identifier hs-var">CmmMayReturn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1198"></span><span>       </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066316"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#baseExpr"><span class="hs-identifier hs-var">baseExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066317"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; ByteOff
forall a. Enum a =&gt; a -&gt; ByteOff
</span><a href="../../base/src/GHC.Enum.html#fromEnum"><span class="hs-identifier hs-var">fromEnum</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681066315"><span class="hs-identifier hs-var">intrbl</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1199"></span><span>
</span><span id="line-1200"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#callResumeThread"><span class="hs-identifier hs-type">callResumeThread</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span>
</span><span id="line-1201"></span><span id="callResumeThread"><span class="annot"><span class="annottext">callResumeThread :: LocalReg -&gt; LocalReg -&gt; CmmNode O O
</span><a href="GHC.Cmm.LayoutStack.html#callResumeThread"><span class="hs-identifier hs-var hs-var">callResumeThread</span></a></span></span><span> </span><span id="local-6989586621681066304"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066304"><span class="hs-identifier hs-var">new_base</span></a></span></span><span> </span><span id="local-6989586621681066303"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066303"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1202"></span><span>  </span><span class="annot"><span class="annottext">ForeignTarget -&gt; [LocalReg] -&gt; [CmmExpr] -&gt; CmmNode O O
</span><a href="GHC.Cmm.Node.html#CmmUnsafeForeignCall"><span class="hs-identifier hs-var">CmmUnsafeForeignCall</span></a></span><span>
</span><span id="line-1203"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; ForeignConvention -&gt; ForeignTarget
</span><a href="GHC.Cmm.Node.html#ForeignTarget"><span class="hs-identifier hs-var">ForeignTarget</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; CmmExpr
</span><a href="GHC.Cmm.LayoutStack.html#foreignLbl"><span class="hs-identifier hs-var">foreignLbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;resumeThread&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1204"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CCallConv
-&gt; [ForeignHint]
-&gt; [ForeignHint]
-&gt; CmmReturnInfo
-&gt; ForeignConvention
</span><a href="GHC.Cmm.Node.html#ForeignConvention"><span class="hs-identifier hs-var">ForeignConvention</span></a></span><span> </span><span class="annot"><span class="annottext">CCallConv
</span><a href="GHC.Types.ForeignCall.html#CCallConv"><span class="hs-identifier hs-var">CCallConv</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CmmReturnInfo
</span><a href="GHC.Cmm.Node.html#CmmMayReturn"><span class="hs-identifier hs-var">CmmMayReturn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1205"></span><span>       </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066304"><span class="hs-identifier hs-var">new_base</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066303"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1206"></span><span>
</span><span id="line-1207"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1208"></span><span>
</span><span id="line-1209"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-type">plusW</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-type">WordOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-1210"></span><span id="plusW"><span class="annot"><span class="annottext">plusW :: Platform -&gt; ByteOff -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#plusW"><span class="hs-identifier hs-var hs-var">plusW</span></a></span></span><span> </span><span id="local-6989586621681066301"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066301"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066300"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066300"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681066299"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066299"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066300"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066299"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066301"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1211"></span><span>
</span><span id="line-1212"></span><span class="hs-keyword">data</span><span> </span><span id="StackSlot"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-var">StackSlot</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Occupied"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="Empty"><span class="annot"><a href="GHC.Cmm.LayoutStack.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span></span><span>
</span><span id="line-1213"></span><span>     </span><span class="hs-comment">-- Occupied: a return address or part of an update frame</span><span>
</span><span id="line-1214"></span><span>
</span><span id="line-1215"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681066295"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-type">StackSlot</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1216"></span><span>  </span><span id="local-6989586621681066294"><span class="annot"><span class="annottext">ppr :: StackSlot -&gt; SDoc
</span><a href="#local-6989586621681066294"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Occupied"><span class="hs-identifier hs-var">Occupied</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;XXX&quot;</span></span><span>
</span><span id="line-1217"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;---&quot;</span></span><span>
</span><span id="line-1218"></span><span>
</span><span id="line-1219"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#dropEmpty"><span class="hs-identifier hs-type">dropEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-type">WordOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-type">StackSlot</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-type">StackSlot</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1220"></span><span id="dropEmpty"><span class="annot"><span class="annottext">dropEmpty :: ByteOff -&gt; [StackSlot] -&gt; Maybe [StackSlot]
</span><a href="GHC.Cmm.LayoutStack.html#dropEmpty"><span class="hs-identifier hs-var hs-var">dropEmpty</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621681066293"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066293"><span class="hs-identifier hs-var">ss</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[StackSlot] -&gt; Maybe [StackSlot]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066293"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-1221"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#dropEmpty"><span class="hs-identifier hs-var">dropEmpty</span></a></span><span> </span><span id="local-6989586621681066292"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066292"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681066291"><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066291"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; [StackSlot] -&gt; Maybe [StackSlot]
</span><a href="GHC.Cmm.LayoutStack.html#dropEmpty"><span class="hs-identifier hs-var">dropEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066292"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><a href="#local-6989586621681066291"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-1222"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#dropEmpty"><span class="hs-identifier hs-var">dropEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[StackSlot]
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [StackSlot]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1223"></span><span>
</span><span id="line-1224"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#isEmpty"><span class="hs-identifier hs-type">isEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackSlot"><span class="hs-identifier hs-type">StackSlot</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1225"></span><span id="isEmpty"><span class="annot"><span class="annottext">isEmpty :: StackSlot -&gt; Bool
</span><a href="GHC.Cmm.LayoutStack.html#isEmpty"><span class="hs-identifier hs-var hs-var">isEmpty</span></a></span></span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><a href="GHC.Cmm.LayoutStack.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1226"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#isEmpty"><span class="hs-identifier hs-var">isEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">StackSlot
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1227"></span><span>
</span><span id="line-1228"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#localRegBytes"><span class="hs-identifier hs-type">localRegBytes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span>
</span><span id="line-1229"></span><span id="localRegBytes"><span class="annot"><span class="annottext">localRegBytes :: Platform -&gt; LocalReg -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#localRegBytes"><span class="hs-identifier hs-var hs-var">localRegBytes</span></a></span></span><span> </span><span id="local-6989586621681066290"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066290"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066289"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066289"><span class="hs-identifier hs-var">r</span></a></span></span><span>
</span><span id="line-1230"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Runtime.Heap.Layout.html#roundUpToWords"><span class="hs-identifier hs-var">roundUpToWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066290"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; ByteOff
</span><a href="GHC.Cmm.Type.html#widthInBytes"><span class="hs-identifier hs-var">widthInBytes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; Width
</span><a href="GHC.Cmm.Type.html#typeWidth"><span class="hs-identifier hs-var">typeWidth</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmType
</span><a href="GHC.Cmm.Expr.html#localRegType"><span class="hs-identifier hs-var">localRegType</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681066289"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1231"></span><span>
</span><span id="line-1232"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#localRegWords"><span class="hs-identifier hs-type">localRegWords</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-type">WordOff</span></a></span><span>
</span><span id="line-1233"></span><span id="localRegWords"><span class="annot"><span class="annottext">localRegWords :: Platform -&gt; LocalReg -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#localRegWords"><span class="hs-identifier hs-var hs-var">localRegWords</span></a></span></span><span> </span><span id="local-6989586621681066286"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066286"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var">toWords</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066286"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteOff -&gt; ByteOff)
-&gt; (LocalReg -&gt; ByteOff) -&gt; LocalReg -&gt; ByteOff
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; LocalReg -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#localRegBytes"><span class="hs-identifier hs-var">localRegBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066286"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1234"></span><span>
</span><span id="line-1235"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-type">toWords</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Types.html#WordOff"><span class="hs-identifier hs-type">WordOff</span></a></span><span>
</span><span id="line-1236"></span><span id="toWords"><span class="annot"><span class="annottext">toWords :: Platform -&gt; ByteOff -&gt; ByteOff
</span><a href="GHC.Cmm.LayoutStack.html#toWords"><span class="hs-identifier hs-var hs-var">toWords</span></a></span></span><span> </span><span id="local-6989586621681066285"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066285"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681066284"><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066284"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteOff
</span><a href="#local-6989586621681066284"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">ByteOff -&gt; ByteOff -&gt; ByteOff
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#quot"><span class="hs-operator hs-var">`quot`</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; ByteOff
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681066285"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-1237"></span><span>
</span><span id="line-1238"></span><span>
</span><span id="line-1239"></span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#stackSlotRegs"><span class="hs-identifier hs-type">stackSlotRegs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackMap"><span class="hs-identifier hs-type">StackMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.LayoutStack.html#StackLoc"><span class="hs-identifier hs-type">StackLoc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1240"></span><span id="stackSlotRegs"><span class="annot"><span class="annottext">stackSlotRegs :: StackMap -&gt; [(LocalReg, ByteOff)]
</span><a href="GHC.Cmm.LayoutStack.html#stackSlotRegs"><span class="hs-identifier hs-var hs-var">stackSlotRegs</span></a></span></span><span> </span><span id="local-6989586621681066282"><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066282"><span class="hs-identifier hs-var">sm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqFM LocalReg (LocalReg, ByteOff) -&gt; [(LocalReg, ByteOff)]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StackMap -&gt; UniqFM LocalReg (LocalReg, ByteOff)
</span><a href="GHC.Cmm.LayoutStack.html#sm_regs"><span class="hs-identifier hs-var hs-var">sm_regs</span></a></span><span> </span><span class="annot"><span class="annottext">StackMap
</span><a href="#local-6989586621681066282"><span class="hs-identifier hs-var">sm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1241"></span><span>  </span><span class="hs-comment">-- See Note [Unique Determinism and code generation]</span><span>
</span><span id="line-1242"></span></pre></body></html>